Ha! I thought there was typo..
content = db.GqlQuery("SELECT * FROM Content WHERE user IN :1 ORDER BY rank
DESC ", reader.subscribed_to)
read it as,
content = db.GqlQuery("SELECT * FROM Content WHERE owner IN :1 ORDER BY rank
DESC ", reader.subscribed_to)
may be there are more :)
On Wed, Jun 16, 2010 at 12:39 AM, Harshal <[email protected]> wrote:
> Hi,
>
> In my app I have a content generator (writer) and content consumer
> (reader). A reader can subscribe to any writer. The way its done so far is,
>
> Writer(db.Model):
> name = db.StringProperty()
> :
> :
>
> Reader(db.Model):
> name = db.StringProperty()
> subscribed_to = db.ListProperty(db.Key) # here I go on appending
> writer.key() every time reader subscribes to writer's content
> :
> :
>
> Content(db.Model):
> title = db.StringProperty()
> owner = db.ReferenceProperty(Writer, collection_name = "content")
> rank = db.IntgerProperty() # Some rank to story to order them while
> fetching.
> :
> :
>
>
> I can get content for a reader to read by,
>
> content = db.GqlQuery("SELECT * FROM Content WHERE user IN :1 ORDER BY rank
> DESC ", reader.subscribed_to) # pseudo code... sorry for any typos.
>
> This approach works great as long as reader doesn't have more than 30
> writers in subscribed_to list (because of IN there) . Any thoughts on how
> make it scale up so that reader is free to subscribe to any number of
> writers and still be able to sort the query by 'rank' ?
>
> Thanks,
> Harshal
>
>
>
>
--
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.