Thx Alkis, I'm familiar with this format but really trying to retain
use of get_list_or_404() functionality. Also are you saying this would
work for numeric ID? What i've got is ID from .key().id() not an
actual User object or .key(). I'm specifically trying not to use Key
().
On May 1, 9:28 am, Alkis Evlogimenos ('Αλκης Ευλογημένος)
<[email protected]> wrote:
> What you want to do is:
>
> albums = Album.all().filter('user =', aUser).fetch(1000)
>
> aUser can be a key to a user or a user entity.
>
>
>
> On Fri, May 1, 2009 at 3:19 PM, Dave <[email protected]> wrote:
>
> > Wow, thx for the super fast respone Nick. You're the best.
>
> > So I am probably still confused. I tried the following:
>
> > queryset = get_list_or_404(Album, 'user =',db.Key.from_path
> > ('User',key))
> > where key = 2. I get "Names may not begin with a digit; received %s.'
> > % id_or_name)"
>
> > This leads be to beleive it's trying to pull a key_name vs. an ID.
>
> > I'm not sure how to use the get_by_id since I'm looking to filter by a
> > reference property of User within the Album model that points to User.
> > It seems Album.get_by_id would return a single album record. I'm
> > looking to get all Albums for a specific user.
>
> > thx,
>
> > On May 1, 9:03 am, "Nick Johnson (Google)" <[email protected]>
> > wrote:
> > > Hi Dave,
>
> > > You have two options here: Construct a Key object from the ID and kind,
> > like so:
>
> > > db.Key.from_path('Album', id)
>
> > > or you can use the convenience method get_by_id on a Model class:
>
> > > Album.get_by_id(id).
>
> > > -Nick Johnson
>
> --
>
> Alkis
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---