#36295: Unable to Override GenericForeignKey in Inherited Abstract Class
--------------------------------------+------------------------------------
Reporter: Gagan Deep | Owner: (none)
Type: Bug | Status: new
Component: contrib.contenttypes | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Senthil Kumar):
This is my first time working with the Django source code. After reviewing
the codebase, I believe the fix below might address the issue. However,
I'm unsure whether this is the expected behavior that requires a
documentation update or if it's an actual bug.
File db/models/base.py -- line 348
{{{
if field.column is not None: # the exact fix
field = copy.deepcopy(field)
if not base._meta.abstract:
field.mti_inherited = True
new_class.add_to_class(field.name, field)
}}}
Apologies, but I'm unsure how to present this from the codebase. It would
be helpful if someone could guide me on how to share the diff, similar to
the comments above. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/36295#comment:4>
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 visit
https://groups.google.com/d/msgid/django-updates/010701960163b30e-0696e18f-e62a-4499-a20a-70c52bd8040d-000000%40eu-central-1.amazonses.com.