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

Django 1.4 support #20

Open
Troyhy opened this issue Jul 30, 2015 · 1 comment
Open

Django 1.4 support #20

Troyhy opened this issue Jul 30, 2015 · 1 comment

Comments

@Troyhy
Copy link

Troyhy commented Jul 30, 2015

This line throws error with django 1.4
https://github.com/bradleyg/django-ajaximage/blob/master/ajaximage/fields.py#L34

This is resolved for example here: estuans@fbf9f33

by removing the 3rd parameter from call to super(AjaxImageField, self).contribute_to_class(cls, name, virtual_only)

If there is a way to do this so that it would support Django 1.4 -> 1.8 this would be nice!

@Troyhy
Copy link
Author

Troyhy commented Jul 30, 2015

Quick fix: I placed this snipped in models.py and used AjaxImageField in my models

from ajaximage.fields import AjaxImageField as BrokenAjaxImageField
#quick fix for ajax image field Only needed with django 1.4
class AjaxImageField(BrokenAjaxImageField):
    def contribute_to_class(self, cls, name, virtual_only=False):
        super(BrokenAjaxImageField, self).contribute_to_class(cls, name)
        setattr(cls, self.name, self.descriptor_class(self))

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