Try: directory.models.Entity.objects.get(pk=id)
Which does pretty much the same thing as: directory.models.Entity.objects.filter(id__exact = id)[0] (note id__exact rather than id__equals) On Jul 14, 3:18 pm, Jonathan Hayward <christos.jonathan.hayw...@gmail.com> wrote: > How do I look up a model instance by id (its primary key)? I have: > > entity = directory.models.Entity.objects.filter(id__equals = id)[0] > > and am getting: > > FieldError at /profile/1 > > Join on field 'id' not permitted. Did you misspell 'equals' for the lookup > type? > > Is there another way I should be going about this given the id field > beforehand? > > -- > → Jonathan Hayward, christos.jonathan.hayw...@gmail.com > → An Orthodox Christian author: theology, literature, et cetera. > → My award-winning collection is available for free reading online: > ☩ I invite you to visit my main site athttp://JonathansCorner.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.