Hi,

I'm not sure if it is possible to make such a query. I guess that the
most straightforward solution would be to add another IntegerProperty
field and just increment/decrement its value when adding/removing
usernames in 'likes'.

Good luck,
Uros

On Mar 1, 10:49 am, ogterran <[email protected]> wrote:
> Hi,
>
> How do I sort based on the number of items on a list?
> i.e.
> class Message(db.Model):
>     text= db.StringProperty(required=True) # text of the message
>     likes= db.StringListProperty() #usernames that liked the message
>
> When the user clicks on the "like" button, his username is appended to the
> likes attribute in Messages
>
> How do I get the top 10 Messages with the most "likes"?
>
> Thanks
> Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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/google-appengine?hl=en.

Reply via email to