#35269: GeneratedFields can't be defined on RelatedFields
-------------------------------------+-------------------------------------
Reporter: Perrine L. | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by fero):
Hello, I think I have developed something that would do for this bug. With
RelatedField on a GeneratedField it is possible to use all wonderful
Django ORM lookup features.
https://github.com/feroda/play-django-generatedfk
Now my implementation requires a separate field (I have called
NoopForeignKey https://github.com/feroda/play-django-
generatedfk/blob/main/noopfk/fields.py), in addition to the
GeneratedField, but I think it is not too much work to integrate the
feature in a dedicated field to be used as `output_field` (maybe:
models.GeneratedForeignKey?) and I am almost confident that it could be a
benefit also for referencing F() foreign key fields that should not
provide only the value of the foreign key, but also the RelatedManager
too.
What do you think about it?
--
Ticket URL: <https://code.djangoproject.com/ticket/35269#comment:2>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018e9de46f63-8501d835-272d-4d5b-bf45-6de5b332cf96-000000%40eu-central-1.amazonses.com.