On Oct 10, 2007, at 1:07 PM, jean-marc pouchoulon wrote:

>
> helo SQLAlchemylist,
>
> I want to purge my mysql database  and delete record selected by date
> with a select_by
>
> In [56]: query_etats.selectfirst().create_date
> Out[56]: datetime.datetime(2007, 7, 31, 17, 24, 32)
>
> In [57]: madate
> Out[57]: datetime.datetime(2007, 8, 21, 18, 33, 9, 542421)
>
> In [58]: print query_etats.select_by(EtatsSmtp.create_date < madate)
> ---------------------------------------------------------------------- 
> -----
> <type 'exceptions.TypeError'>             Traceback (most recent  
> call last)
>
> /home/bin/applis/smtpcheck/smtpcheck/<ipython console> in <module>()
>
> <type 'exceptions.TypeError'>: can't compare datetime.datetime to
> UOWProperty
>

you want to be on version 0.4 of SQLAlchemy to do an operation like  
that.  if on version .3, "EtatsSmtp.c.create_date < madate".

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to