#5826: Can't recover GenericForeignKey content type and object id field names
-----------------------+----------------------------------------------------
Reporter: kgoudeaux | Owner: nobody
Status: new | Component: Contrib apps
Version: SVN | Keywords: ContentType GenericForeignKey generic
relations
Stage: Unreviewed | Has_patch: 1
-----------------------+----------------------------------------------------
The !GenericForeignKey class is perfect for recovering the object it
references but leaves no way to recover ''itself'' and the field names it
stores.
Its __get__ function only returns the object it references or an
error.[[BR]]
!DoesNotExist when it isn't set on an instance.[[BR]]
!AttributeError when accessed from the model class.[[BR]]
This one line patch and doc test changes the behavior of __get__ to return
the GenericForeignKey instance when accessed from the model class thereby
allowing access to the content type and primary key field names.
--
Ticket URL: <http://code.djangoproject.com/ticket/5826>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---