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

Added __len__ function to CloudinaryImage #46

Merged
merged 1 commit into from
Aug 6, 2015

Conversation

rtrajano
Copy link
Contributor

Django's MaxLengthValidator is called in Django Rest Framework
serializers on fields with max_length. This checks the value of the
CloudinaryImageField since it specifies a max_length of 100.
The value in the field is a CloudinaryImage which doesn't have
a len function and errors out.

  • added a len function to CloudinaryImage that returns the length of
    public_id
  • added a test

Django's MaxLengthValidator is called in Django Rest Framework
serializers on fields with max_length. This checks the value of the
CloudinaryImageField since it specifies a max_length of 100.
The value in the field is a CloudinaryImage which doesn't have
a __len__ function and errors out.

* added a __len__ function to CloudinaryImage that returns the length of
  public_id
* added a test
tocker added a commit that referenced this pull request Aug 6, 2015
Added __len__ function to CloudinaryImage
@tocker tocker merged commit 9a5f080 into cloudinary:master Aug 6, 2015
@tocker
Copy link
Contributor

tocker commented Aug 6, 2015

@rtrajano thanks for PR!

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

Successfully merging this pull request may close these issues.

2 participants