Closed jedie closed 9 years ago
I faced this issue too. But I'm not sure if #36 is real fix for that.
This is likely due to either early imports of models somewhere or circular imports. Which django CMS version?
in my case: 3.0.9
any specific application in installed apps? I can't reproduce this
INSTALLED_APPS = ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.staticfiles', 'django.contrib.messages', 'cms', 'djangocms_admin_style', 'djangocms_text_ckeditor', 'menus', 'sekizai', 'mptt', 'djangocms_file', 'djangocms_link', 'djangocms_picture', 'djangocms_video', 'cmsplugin_htmlsitemap', 'cmsplugin_pygments', 'reversion', 'reversion_compare', 'compressor', 'django_extensions', 'filer', 'easy_thumbnails', 'cmsplugin_filer_image', 'parler', 'taggit', 'taggit_autosuggest', 'django_select2', 'meta', 'meta_mixin', 'admin_enhancer', 'djangocms_blog', 'django_info_panel')
3.0.10 for me. I bet on early import of models.
Hi @yakky . I've created failing example here : https://github.com/galuszkak/djangocmslink_bug
If you have any question I will explain. This example will fail on ./manage.py migrate
Thanks @galuszkak ! Will look into this
Hello, I have the same problem. Any news on this?
Same problem, it indeed looks like an early lookup of DB, incompatible with the new django1.7 setup system, here:
File "/home/pakal/webapps/devs/ENV/lib/python2.7/site-packages/djangocms_link/forms.py", line 12, in LinkForm pagelink = PageSearchField(queryset=Page.objects.drafts(), label=("Page"), required=False)
I worked around this by removing djangocms-link from installed apps, sync'ing DBs, and then only installing djangocms-link (now that djangocms parent tables were setup).
I'm getting the same issue here with a brand new project, empty database.
Django 1.7.7 and CMS 3.0.12
Traceback is as @pakal said;
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/contrib/admin/apps.py", line 22, in ready
self.module.autodiscover()
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 23, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/utils/module_loading.py", line 74, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/cms/admin/__init__.py", line 11, in <module>
plugin_pool.plugin_pool.discover_plugins()
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/cms/plugin_pool.py", line 36, in discover_plugins
load('cms_plugins')
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/cms/utils/django_load.py", line 56, in load
get_module(app, modname, verbose, failfast)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/cms/utils/django_load.py", line 40, in get_module
module = import_module(module_name)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/utils/importlib.py", line 46, in import_module
__import__(name)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/djangocms_link/cms_plugins.py", line 8, in <module>
from djangocms_link.forms import LinkForm
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/djangocms_link/forms.py", line 9, in <module>
class LinkForm(ModelForm):
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/djangocms_link/forms.py", line 12, in LinkForm
page_link = PageSearchField(queryset=Page.objects.drafts(), label=_("Page"), required=False)
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django_select2/fields.py", line 305, in __call__
if not queryset and hasattr(cls, '_subclass_queryset'):
File "/Users/mwalker/Sites/ENV/lib/python2.7/site-packages/django/db/models/query.py", line 145, in __nonzero__
self._fetch_all()
@marksweb @galuszkak @pakal @jkirschner42 @jedie could you check if this branch https://github.com/yakky/djangocms-link/tree/fix_queryset fix the issue?
I'm testing now. :)
@yakky yes, it fixes the problem. You can merge this :+1: . Thanks!
Good job @yakky :)
Will you release this soon in 1.6?
If i try to run syncdb, i get this error:
Think the related code is: PageSearchField(queryset=Page.objects.drafts()