fusionbox/django-widgy — pull request #245 by gavinwahl (2014-08-22 21:46:53+00:00)
Title: Fixup model loading

- Using get_field_by_name loads the appcache, which is not allowed in a models module. Use get_field(False), which only looks at local fields and does not require populating the cache. This helps with #177.

- Do not call get_layout_contenttypes during model loading by making it lazy. get_layout_contenttypes does a ContentQuery, which requires that the django_content_type exists, which is not true during syncdb. This makes the DEBUG_TOOLBAR_PATCH_SETTINGS workaround in #244, #214, #235 unnecessary.

This paves the way for django 1.7 compatibility without the workarounds in #177. We also need to make scss_compile calls in page_builder.forms lazy (it uses staticfiles), but then we should be pretty close.