Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request feincms#378 from ixc/master
Browse files Browse the repository at this point in the history
Only doing minimal cache building when registering a content_type.
  • Loading branch information
matthiask committed Jan 10, 2013
2 parents 9b77712 + 3ceb1a3 commit 3705cc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions feincms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __getattr__(self, attr):


COMPLETELY_LOADED = False
def ensure_completely_loaded(force=False):
def ensure_completely_loaded():
"""
This method ensures all models are completely loaded
Expand All @@ -36,7 +36,7 @@ def ensure_completely_loaded(force=False):
"""

global COMPLETELY_LOADED
if COMPLETELY_LOADED and not force:
if COMPLETELY_LOADED:
return True

# Ensure meta information concerning related fields is up-to-date.
Expand Down
5 changes: 4 additions & 1 deletion feincms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,10 @@ class Meta(feincms_content_base.Meta):
for key, includes in model.feincms_item_editor_includes.items():
cls.feincms_item_editor_includes.setdefault(key, set()).update(includes)

ensure_completely_loaded(force=True)
# since this content type is potentially being added after cls is
# loaded by Django, we will reload the cls's related objects cache.
# See issue #323.
cls._meta._fill_related_objects_cache()
return new_type

@property
Expand Down

0 comments on commit 3705cc7

Please sign in to comment.