I have some(8 exactly) entries in db, and want to get all of them,
filtered by creation time >= some constant FROM_TIME
so, every single entry has .insert_order (creation time attr in fact)
property, that is greater then FROM_TIME

so, when i dont filter by time, i got all 8, and their insert_order
property is >= FROM_TYME constant ( <type 'datetime.datetime'> too)

but when i enable filter, i got only 7 entries, whose creation time
was in last 2009 year
last entry, what i have created in this year, does not displays when
filtered

run is local

i dont understand why, please help me or explain. Thanks!


model class is simple, like this:

class Submissions(db.Model):
    ip_addr = db.StringProperty()
    insert_order = db.DateTimeProperty(auto_now_add=True)

========================================= first listing, filter by
date is commented

#from app.pager import SearchablePagerQuery, PagerQuery
from datetime import datetime,timedelta
FOR_N_DAYS = 30                                       # we show only
last-N-days ads
FROM_TIME  = datetime.today() - timedelta(days=FOR_N_DAYS) # last N
days
query = Submissions.all() #.filter("insert_order >=",FROM_TIME)
print query.count()
items = query.fetch(10)
print
for i in items:
  print i
  print i.insert_order
  print (i.insert_order >= FROM_TIME )
==========================================
and output is:

8

2009-12-29 06:55:56.443000
True
2009-12-30 07:49:37.123000
True
2009-12-30 07:49:58.918000
True
2009-12-30 07:50:41.538000
True
2009-12-30 07:54:18.276000
True
2009-12-30 07:55:14.090000
True
2009-12-30 07:55:31.374000
True
2010-01-02 19:32:15.046000
True


But when i uncomment (.filter("insert_order >=",FROM_TIME)) - the
output is different:
7


2009-12-29 06:55:56.443000
True
2009-12-30 07:49:37.123000
True
2009-12-30 07:49:58.918000
True
2009-12-30 07:50:41.538000
True
2009-12-30 07:54:18.276000
True
2009-12-30 07:55:14.090000
True
2009-12-30 07:55:31.374000
True

--

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


Reply via email to