Re: [sqlalchemy] is True vs ==True

2015-04-01 Thread Jonathan Vanasco
On Wednesday, April 1, 2015 at 2:56:31 AM UTC-4, jo wrote: *session.query(Rischio.c.codice).select_from(Rischio).filter(Rischio.c.peso_gruppo == '1') #**true* *session.query(Rischio.c.codice).select_from(Rischio).filter(Rischio.c.peso_gruppo == '0') #false* I don't think that

[sqlalchemy] is True vs ==True

2015-03-30 Thread Jose Soares
Hi all, While I changed some obsolete syntax as defined in (https://www.python.org/dev/peps/pep-0008/) like (is True instead of ==True) also False and None. I realized that sqlalchemy do not support them What can I do to avoid this behavior?

Re: [sqlalchemy] is True vs ==True

2015-03-30 Thread Jose Soares
Hmm! in this case we must distinguish between the python syntax and the sqlalchemy syntax.:-( j On 30/03/2015 12:37, Simon King wrote: On Mon, Mar 30, 2015 at 10:59 AM, Jose Soares jose.soa...@sferacarta.com wrote: Hi all, While I changed some obsolete syntax as defined in

Re: [sqlalchemy] is True vs ==True

2015-03-30 Thread Richard Gerd Kuesters | Pollux
there's this: * import sqlalchemy as sa** ** sa.sql.null()** **sqlalchemy.sql.elements.Null object at 0x7f8a70065c50** ** sa.sql.false()** **sqlalchemy.sql.elements.False_ object at 0x7f8a6fb13050** ** sa.sql.true()** **sqlalchemy.sql.elements.True_ object at 0x7f8a70065c50** * so, you can still

Re: [sqlalchemy] is True vs ==True

2015-03-30 Thread Simon King
On Mon, Mar 30, 2015 at 10:59 AM, Jose Soares jose.soa...@sferacarta.com wrote: Hi all, While I changed some obsolete syntax as defined in (https://www.python.org/dev/peps/pep-0008/) like (is True instead of ==True) also False and None. I realized that sqlalchemy do not support them What

Re: [sqlalchemy] is True vs ==True

2015-03-30 Thread Mathieu Leduc-Hamel
why not just called it that way: filter(Rischio.c.peso_gruppo.is_(True)) And it would be the same thing for None and False And the opposite would be: filter(not_(Rischio.c.peso_gruppo.is_(None))) Le lun. 30 mars 2015 à 11:10, Jonathan Vanasco jonat...@findmeon.com a écrit : If

Re: [sqlalchemy] is True vs ==True

2015-03-30 Thread Jose Soares
Yeah, this is a good solution. Thanks for the tip. j On 30/03/2015 16:33, Richard Gerd Kuesters | Pollux wrote: there's this: * import sqlalchemy as sa** ** sa.sql.null()** **sqlalchemy.sql.elements.Null object at 0x7f8a70065c50** ** sa.sql.false()** **sqlalchemy.sql.elements.False_ object at

Re: [sqlalchemy] is True vs ==True

2015-03-30 Thread Jonathan Vanasco
If you're just worried about warnings in Flake8, you can turn them off line-by-line: filter( Rischio.c.peso_gruppo == True # noqa )\ -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop