System check fields.E300 does not allow for related fields involving auto_created through models.
The model system checks will raise the fields.E300 error if you make an auto_created through model the target of a related field. Here is an example of models that will trigger this error:
class E300TestModelA(models.Model):
pass
class E300TestModelB(models.Model):
many_to_many_rel = models.ManyToManyField(E300TestModelA)
class E300TestModelC(models.Model):
one_to_one_rel = models.OneToOneField("check_framework.E300TestModelB_many_to_many_rel", on_delete=models.CASCADE)
I realize this might be an unusual thing to do, however I have a use case that requires this and thought I would create this ticket in case others agree that this should be changed. I will create a pull request shortly.
Change History
(10)
Owner: |
set to Jason Bruce
|
Status: |
new → assigned
|
Owner: |
Jason Bruce removed
|
Status: |
assigned → new
|
Cc: |
Simon Charette added
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
set to Jason Bruce
|
Patch needs improvement: |
set
|
Status: |
new → assigned
|
Owner: |
Jason Bruce removed
|
Patch needs improvement: |
unset
|
Status: |
assigned → new
|
Owner: |
set to Jason Bruce
|
Status: |
new → assigned
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
I created a pull request with a fix for the bug and a regression test.