Skip to content
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

contribute_to_class() takes exactly 3 arguments (4 given) #12

Open
Darex1991 opened this issue Apr 8, 2014 · 0 comments
Open

contribute_to_class() takes exactly 3 arguments (4 given) #12

Darex1991 opened this issue Apr 8, 2014 · 0 comments

Comments

@Darex1991
Copy link

Hi when i syncdb i get error:

ajaximage\fields.py", line 34, in contribute_to_class
super(AjaxImageField, self).contribute_to_class(cls, name, virtual_only)
TypeError: Error when calling the metaclass bases
contribute_to_class() takes exactly 3 arguments (4 given)

then I remove virtual_only from 34 line and i get now error when I try save model:

"ajaximage\widgets.py in render, line 57"
"Error during template rendering
In template C:\Python27\lib\site-packages\django\contrib\admin\templates\admin\includes\fieldset.html, error at line 19"

If anyone have the same problem, please help me.. a try:

Replace (ajaximage\widgets.py in render, line 57):
file_url = value.url if value else ''
with:
file_url = value.url if value else str('')

error

I DO IT!!! But when i save model without name I get error about file_url = value.url if value else ''
I remove virtual_only=False and virtual_only from contribute_to_class in fields.py. THe results:
ajaximage\fields.py line 33- 35:

def contribute_to_class(self, cls, name):
super(AjaxImageField, self).contribute_to_class(cls, name)
setattr(cls, self.name, self.descriptor_class(self))

I try :
#12

@Darex1991 Darex1991 changed the title 'unicode' object has no attribute 'url' contribute_to_class() takes exactly 3 arguments (4 given) Apr 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant