Hi tijer,

Is it possible that there are simply no results for the two-filter
query? It looks like when inserting a new UserTrack entity, the user
is set to the current user and the lastvisit time is set to now. So I
imagine looking for a UserTrack where lastvisit > now may not have
very many results, lastvisit < now would likely have more.

Happy coding,

Jeff

On Feb 16, 9:13 am, tijer <troels...@gmail.com> wrote:
> I ran into this problem, and it's unclear to my why it doesn't work. I
> looked carefully in the documentation and can't see that it should be
> an illegal operation, but still, I seem to recieve no results from the
> query.
>
> What I'm trying to do is to fetch all the rows in a datastore model
> that has a specific userproperty-value AND something newer than a
> certain date on a datetimeproperty.
>
> Currently, it looks like this:
>
>   class UserTrack(db.Model):
>     user = db.UserProperty() # Google user
>     parentpost = db.ReferenceProperty(reference_class=Post,
> collection_name='usertrack_parentpost_tasks')
>     lastvisit = db.DateTimeProperty(auto_now=True)
>
>   (...)
>
>   user = users.get_current_user()
>   datetime_of_current_visit = datetime.utcnow()
>
>   usertrackquery = UserTrack.all()
>   usertrackquery.filter('user =', user)
>   usertrackquery.filter('lastvisit >', datetime_of_current_visit)
>   usertracks = usertrackquery.fetch(limit=25)
>
> If I delete either of the two filters (on user OR on lastvisit) I get
> results, but if I take the two together the datastore always returns
> None (without an error). I know for sure that some of the rows are
> true for both of the two conditions, but still I get None. (actually,
> if none of the rows would match I would still get an empty list, and
> not None).
>
> Did I break the policy of equality filters and is that why it doesn't
> work? If so how? Any ideas?
--~--~---------~--~----~------------~-------~--~----~
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-appengine@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