Fix m2m relationships from extensions to built-in models.
Review Request #6224 — Created Aug. 13, 2014 and discarded
Django caches a bunch of field information so when we side load our
extension Models any relationships added will not be propogated to the
related Model. This will cause problems where something tries to access
the related name of the extension Model from the built-in Model.We now flush the caches on the related built-in Models when enabling
an extension.
Tested using the AutomaticRunGroup Model in Review Bot which relates
to the Repository Model. The admin interface for changing the
AutomaticRunGroup entry now loads properly.
Description | From | Last Updated |
---|---|---|
Extensions can include a list of apps they provide as well (Extension.apps). We should include those in the list of … |
chipx86 | |
We should include the module path for the model. |
chipx86 | |
Col: 80 E501 line too long (124 > 79 characters) |
reviewbot | |
That's kind of a scary line. Let's pull things out into a list, and then iterate. I'd prefer this format: … |
chipx86 | |
Col: 80 E501 line too long (87 > 79 characters) |
reviewbot | |
Included this comment for context right here, but it's stolen verbatim from the django source code. I will be removing … |
SM smacleod | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (88 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot |
-
Do we know if ForeignKeys were also impacted by this bug?
-
Extensions can include a list of apps they provide as well (Extension.apps). We should include those in the list of model modules.
-
-
That's kind of a scary line. Let's pull things out into a list, and then iterate.
I'd prefer this format:
model_classes = [ cls for name, cls in inspect.... if inspect.... ]