summaryrefslogtreecommitdiff
path: root/django/apps
diff options
context:
space:
mode:
authorDaniel Pyrathon <pirosb3@gmail.com>2015-01-06 19:16:35 -0500
committerTim Graham <timograham@gmail.com>2015-01-06 19:25:12 -0500
commitfb48eb05816b1ac87d58696cdfe48be18c901f16 (patch)
tree3d2e981b6f3fafdeb7310d0734fb148ebb7f6aef /django/apps
parent749d23251bbd6564341405e6f8c1da129b8307e7 (diff)
Fixed #12663 -- Formalized the Model._meta API for retrieving fields.
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
Diffstat (limited to 'django/apps')
-rw-r--r--django/apps/registry.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py
index fe53d965de..68aa411d91 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -337,7 +337,12 @@ class Apps(object):
This is mostly used in tests.
"""
+ # Call expire cache on each model. This will purge
+ # the relation tree and the fields cache.
self.get_models.cache_clear()
+ if self.ready:
+ for model in self.get_models(include_auto_created=True):
+ model._meta._expire_cache()
### DEPRECATED METHODS GO BELOW THIS LINE ###