type object 'ReportForm' has no attribute '_feincms_content_types'

54 views
Skip to first unread message

Abu Yusuf

unread,
Oct 1, 2020, 2:28:00 PM10/1/20
to Django FeinCMS
I have an application with python 2.7 and fein-cms 1.12.1 and it was working fine.
But recently i did migrate to python 3.5 and it's raising an error: type object 'ReportForm' has no attribute '_feincms_content_types'

How can I solve it. What was the issue?

Thanks in advance.

Matthias Kestenholz

unread,
Oct 1, 2020, 2:50:52 PM10/1/20
to FeinCMS
Hi

`_feincms_content_types` is initialized inside `feincms.models.Base` when the first call to `.create_content_type()` happens. Where is the location of your create_content_type calls? Maybe the loading order changed in newer Django versions.

Did you also upgrade Django by chance? Which version of Django are you using? The build is mostly green https://travis-ci.org/github/feincms/feincms so at least Django 2.2.x LTS should work fine.

Matthias



--
You received this message because you are subscribed to the Google Groups "Django FeinCMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-feincm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-feincms/dbc4537e-3694-48ac-8657-16b0879e5f53n%40googlegroups.com.


--
Feinheit AG - Matthias Kestenholz - Direkt +41 79 444 78 96 - Zentrale +41 555 11 11 41

Abu Yusuf

unread,
Oct 1, 2020, 2:55:13 PM10/1/20
to Django FeinCMS
I'm using djnago 1.8

Matthias Kestenholz

unread,
Oct 1, 2020, 3:02:25 PM10/1/20
to FeinCMS
Oh, I'm not sure then. Django 1.8 hasn't been supported for over two years now https://www.djangoproject.com/download/ – I strongly advise an upgrade to 1.11 (which had its end of life only half a year ago) or better yet, 2.2 LTS. Especially if you're finally ready to switch to Python 3.



Abu Yusuf

unread,
Oct 1, 2020, 3:04:52 PM10/1/20
to Django FeinCMS
Yes, i'm upgrading step by step. If everything works fine for 1.8 then I will move to 1.9/1.11
But I'm stuck here. Couldn't get any solution for that.

Matthias Kestenholz

unread,
Oct 1, 2020, 3:10:27 PM10/1/20
to FeinCMS
Do you have a full traceback somewhere? That could be useful.

Until now you just posted the final exception, but sometimes the stack provides additional details.

Matthias



Abu Yusuf

unread,
Oct 1, 2020, 3:15:45 PM10/1/20
to Django FeinCMS

Abu Yusuf

unread,
Oct 1, 2020, 3:17:55 PM10/1/20
to Django FeinCMS
Exception Value:
type object 'ReportForm' has no attribute '_feincms_content_types'Exception Location:
/home/yusuf/Documents/py3.5_env/lib/python3.5/site-packages/feincms/admin/item_editor.py in get_content_type_map, line 132

Abu Yusuf

unread,
Oct 7, 2020, 3:11:57 PM10/7/20
to Django FeinCMS
Hey Matthias Kestenholz,

I did upgrade my project to django-2.0 but still, I'm getting the same error. Here is my code:

models:
class MyForm(create_base_model()):
    name = models.CharField(max_length=255, default='New Report', unique=True)
    title = models.CharField(max_length=255)

# Attach content types to Report
report = ReportForm()
report.register_regions(
('main', 'Main content'),
)

map(report.create_content_type, CONTENT_TYPES)

admin:
admin.site.register(MyForm, ItemEditor)
Reply all
Reply to author
Forward
0 new messages