-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with Python 3.X #25
Comments
This doesn't really look like it's python 3 but more a general thing. The traceback looks more like the Meta object of the form doesn't handle the alias from document to model correctly. If I remember this correctly I tried to use So could you try to change every occurrence of |
Looking closer at this |
Thanks a lot it's working now, I just opened #27 for a simple import bug. |
I'm using Python 3.3 with latest django-trunk, mongoengine and pymongo versions from github.
I had some "ImportError: cannot import name smart_unicode", same for force_unicode.
I just commented the import line of these two functions and replaced them by functions doing nothing.
I'm trying to make it work using a simple CreateView:
forms.py
class FeedbackForm(DocumentForm):
class Meta:
model = Feedback
fields = ['name', 'email', 'subject', 'message']
views.py
class FeedbackCreate(CreateView):
model = Feedback
form_class = FeedbackForm
model.py
class Feedback(Document):
name = StringField(max_length=120)
email = EmailField()
subject = StringField(max_length=120)
message = StringField(max_length=1000, required=True)
meta = {'allow_inheritance': False, 'indexes': ['id']}
But all I get is:
Internal Server Error: /fr/contact/
Traceback (most recent call last):
File "/usr/local/lib/python3.3/dist-packages/django/core/handlers/base.py", line 114, in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
File "/usr/local/lib/python3.3/dist-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, _args, *_kwargs)
File "/usr/local/lib/python3.3/dist-packages/django/views/generic/base.py", line 86, in dispatch
return handler(request, _args, *_kwargs)
File "/usr/local/lib/python3.3/dist-packages/django/views/generic/edit.py", line 190, in get
return super(BaseCreateView, self).get(request, _args, *_kwargs)
File "/usr/local/lib/python3.3/dist-packages/django/views/generic/edit.py", line 149, in get
form = self.get_form(form_class)
File "/usr/local/lib/python3.3/dist-packages/django/views/generic/edit.py", line 37, in get_form
return form_class(**self.get_form_kwargs())
File "/usr/local/lib/python3.3/dist-packages/mongodbforms-0.1.5-py3.3.egg/mongodbforms/documents.py", line 268, in init
raise ValueError('DocumentForm has no document class specified.')
ValueError: DocumentForm has no document class specified.
The text was updated successfully, but these errors were encountered: