Opened 10 years ago
Closed 10 years ago
#24236 closed Bug (fixed)
Custom ManyToManyFields don't generate SQL database changes
Reported by: | Markus Holtermann | Owned by: | Markus Holtermann |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.7 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Regression introduced in 3d4a826174b7a411a03be39725e60c940944a7fe
If user writes a class, inherited from ManyToManyField
("custom" m2m field) and doesn't define a get_internal_type(): return "ManyToManyField
the schema backends won't recognize it as a m2m field and thus don't treat it as such.
This breaks existing code.
Change History (11)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Has patch: | set |
---|---|
Type: | Uncategorized → Bug |
comment:3 by , 10 years ago
Maybe bug is not here.
Related fields are not explicitly define the internal type. As I can see, non-related fields define it explicitly. (for example, https://github.com/django/django/blob/0f3ea8c0bc9c7f7f5e448b0b2137bc6351f5eae3/django/db/models/fields/__init__.py#L1785)
comment:4 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:5 by , 10 years ago
See also the discussion on the django- developers mailing list: https://groups.google.com/d/msg/django-developers/-zQL0skuPh0/zUHWeAph6yAJ
comment:6 by , 10 years ago
Needs documentation: | set |
---|
comment:7 by , 10 years ago
Needs documentation: | unset |
---|
comment:8 by , 10 years ago
Status: | new → assigned |
---|
comment:9 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:11 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
PR: https://github.com/django/django/pull/3998