#32802: Ability to generate GenericForeignKey from class properties
-------------------------------------+-------------------------------------
Reporter: Timur | Owner: nobody
Kadyev |
Type: New | Status: new
feature |
Component: | Version: 3.2
contrib.contenttypes |
Severity: Normal | Keywords: GenericForeignKey
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Generating GenericForeignKey currently assumes pass it the names of the
two fields. These fields are default named “content_type” and “object_id”.
Sometimes in practice it is convenient to calculate the values of these
fields (ex. property). In this case, you have to create two additional
fields in which you need to write properties values in order to pass the
GenericForeignKey name validation.
It would be nice to change the GenericForeignKey name validation to accept
not only fields but also properties.
--
Ticket URL: <https://code.djangoproject.com/ticket/32802>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.