In Django 1.7 Python3 using Floppyforms 1.3 keeps getting "TypeError: object () does not take any parameters" error

Now this is mostly informational as I figured out the error.

Background: Django 1.7 app with update form for MyModel.

My form looked like this:

import floppyforms as forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import *
from crispy_forms.bootstrap import *

class MyCustomForm(forms.ModelForm):
    user_name = forms.CharField()
    email = forms.CharField()
    phone = forms.CharField()
    first_name = forms.CharField()
    last_name = forms.CharField()

class Meta:
    model = MyCustomModel

      

Unfortunately I keep getting the following error:

Traceback (most recent call last): File "/usr/local/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py", line 64, in __call__ return self.application(environ, start_response) ... File "/usr/local/lib/python3.4/site-packages/floppyforms/models.py", line 22, in __new__ return super(ModelForm, cls).__new__(cls, *args, **kwargs) TypeError: object() takes no parameters

I'm not sure why this is happening, but the error message doesn't help much.

+3


source to share


1 answer


Got me nuts for a few days, finally resolving this by adding .__future__

in floppyforms import.

import floppyforms.__future__ as forms

      



Now the code is happy :)

+5


source







All Articles