AttributeError: type object 'Page' has no attribute '_feincms_templates'

34 views
Skip to first unread message

Bika

unread,
Aug 17, 2010, 5:30:44 AM8/17/10
to django-...@googlegroups.com
Hi,

I've installed feincms, if I set DEBUG=True, then it runs fine
but if I set DEBUG=False, then I get the following error:

Traceback (most recent call last):

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/core/handlers/base.py", line 91, in get_response
   request.path_info)

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/core/urlresolvers.py", line 214, in resolve
   for pattern in self.url_patterns:

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/core/urlresolvers.py", line 243, in _get_url_patterns
   patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/core/urlresolvers.py", line 238, in _get_urlconf_module
   self._urlconf_module = import_module(self.urlconf_name)

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/utils/importlib.py", line 35, in import_module
   __import__(name)

 File "/home/akasha/bzr/openerp-site/urls.py", line 9, in <module>
   admin.autodiscover()

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/contrib/admin/__init__.py", line 24, in autodiscover
   import_module('%s.admin' % app)

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/utils/importlib.py", line 35, in import_module
   __import__(name)

 File "/home/akasha/virtualenv/openerp/src/feincms/feincms/module/page/admin.py", line 6, in <module>
   admin.site.register(Page, PageAdmin)

 File "/home/akasha/virtualenv/openerp/lib/python2.5/site-packages/django/contrib/admin/sites.py", line 93, in register
   self._registry[model] = admin_class(model, self)

 File "/home/akasha/virtualenv/openerp/src/feincms/feincms/module/page/models.py", line 672, in __init__
   if len(Page._feincms_templates) > 4:

AttributeError: type object 'Page' has no attribute '_feincms_templates'

I've tried to use the django shell, and of course, Page does have the problematic attribute.

What point do I miss?

thanks, Viktor

Simon Meers

unread,
Aug 17, 2010, 6:44:30 AM8/17/10
to django-...@googlegroups.com
Some colleagues of mine came across this yesterday in fact. They did not get to the bottom of it, but discovered a workaround -- importing feincms.models at the top of the urls.py file before admin.autodiscover() resolved the issue. We need to look into the root cause, however...

--
You received this message because you are subscribed to the Google Groups "Django FeinCMS" group.
To post to this group, send email to django-...@googlegroups.com.
To unsubscribe from this group, send email to django-feincm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-feincms?hl=en.

Matthias Kestenholz

unread,
Sep 6, 2010, 3:35:30 AM9/6/10
to django-...@googlegroups.com
On Tue, Aug 17, 2010 at 12:44 PM, Simon Meers <drm...@gmail.com> wrote:
> Some colleagues of mine came across this yesterday in fact. They did not get
> to the bottom of it, but discovered a workaround -- importing feincms.models
> at the top of the urls.py file before admin.autodiscover() resolved the
> issue. We need to look into the root cause, however...
>

This is the case if the ItemEditor code runs before the Django project
is fully initialized. The get_validation_errors call in
ItemEditor.__init__ should take care of this error in recent FeinCMS
versions (not sure whether released or not)


Matthias

Reply all
Reply to author
Forward
0 new messages