On Dec 18, 2012, at 3:53 AM, Yap Sok Ann wrote:

> There are a few places in my code that does `q.filter(None)`, e.g. something 
> like this:
> 
>     def base_filter(self):
>         # subclasses may set this, or not
>         pass
> 
>     def base_query(self):
>         q = self.model_cls.query
>         q = q.filter(self.base_filter())
>         return q
> 
> Previously, it would generate "SELECT * FROM xxx".
> 
> In 0.8, it now generates "SELECT * FROM xxx WHERE NULL", and subsequently no 
> row is returned.
> 
> The change was introduced 2 months ago in 
> http://sqlalchemy.org/trac/changeset/b221bb4385a4
> 
> Anyway, the 0.8 behavior does feel a bit more correct, so perhaps I shall fix 
> my code instead :)


yeah there's no specific use case I had anticipated for filter(None) but 
rendering NULL is more consistent.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to