views:

30

answers:

2

My query is essentially the following:

entries=Entry.all().order("-votes").order("-date").filter("votes >", VOTE_FILTER).fetch(PAGE_SIZE+1, page* PAGE_SIZE)

I want to grab N of the latest entries that have a voting score above some benchmark (VOTE_FILTER). Google currently says that I cannot filter on 'votes' because I order by 'date.' I don't see a way that I can do this the way I want to, so I'd appreciate any advice.

A: 

Yep, there are Restrictions on Queries as this is Gql not Sql. It looks like you'll need to use a Query Cursor and reject entries on votes <= VOTEFILTER in your code.

The semantics of Bigtable are certainly different than an RDBM and I'm still trying to wrap my head around them, too.

msw
+4  A: 

Assuming your 'vote filter' is a fixed threshold, you need to add a property to your model that records if it's above that threshold or not, enabling you to do a simple equality test to determine which records should be included.

Nick Johnson
+1 thanks - I like that approach.
msw