Ticket #8909: ref-contrib-contenttypes.diff

File ref-contrib-contenttypes.diff, 641 bytes (added by arien, 7 years ago)
  • docs/ref/contrib/contenttypes.txt

     
    305305
    306306If you don't add the reverse relationship, you can do the lookup manually::
    307307
    308     >>> b = Bookmark.objects.get(url='http://www.djangoproject.com/)
     308    >>> b = Bookmark.objects.get(url='http://www.djangoproject.com/')
    309309    >>> bookmark_type = ContentType.objects.get_for_model(b)
    310310    >>> TaggedItem.objects.filter(content_type__pk=bookmark_type.id,
    311311    ...                           object_id=b.id)
Back to Top