Git Product home page Git Product logo

django_cropper_image's People

Contributors

aneesh2usman avatar carlguo866 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django_cropper_image's Issues

Readme

@aneesh2usman could you add the compatible python and django versions in the readme?
That'd be quite helpful.

Not provided image is not handled

I would like to use the app to make profile photo upload easy. I have a default User model in Django (5.01) and there is a Profile model with one to one link to the user model. When a user registers, I create a Profile instance with th foreign key and leave the other blank. Here is the field definition:

from django_cropper_image.fields import ImageCropperField
class UserProfile(models.Model):
...
avatar = ImageCropperField(verbose_name="Profil fotó",
                               upload_to="photos/%Y/%m",
                               max_length=255,
                               blank=True,
                               null=True)
...

When I try to save my profile, where the avatar field is empty as all the others but the user, I got an exception:

AttributeError: 'NoneType' object has no attribute 'get'

The issue is within your fields.py file at row 184 in pre_save method, the following line:

self.b64data = self.cropperconstobj.get()

Obviously the self.cropperconstobj is None.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.