Python & Peewee Query Example Needed

Travis VanDame tvandame at financegenius.com
Mon Feb 16 14:08:18 EST 2015


On Monday, February 16, 2015 at 12:35:00 PM UTC-6, Travis VanDame wrote:
> I'm new to python and peewee and was looking for an example on how to query a mysql table with a datetime column only returning rows that are 30 days old.

Well this is what I've come up with....

   @classmethod
    def get_archive_xml(cls, day_count):
        return cls.select().where(cls.created + datetime.timedelta(days=int(day_count)) >= datetime.date.today())



More information about the Python-list mailing list