Image handling views
Base image handling Views
If not disabled, each image model need to have 3 views for uploading, fetching and cropping. User should subclass the following Class-based image handling base views for your custom image models.
- class galleryfield.image_views.ImageCreateView(**kwargs)[source]
The Class-based view handling the saving of uploaded image.
- target_model
When not set, defaults to
garllery_widget.BuiltInGalleryImage
- crop_url_name
When
disable_server_side_crop
is False, ifNone
or an invalid URL name will raise anImproperlyConfigured
error.
- disable_server_side_crop
Defaults to
False
- form_valid(form)[source]
User should override this method to save the object, for example, image model usually has a non-null user field, that should be handled here.
See the-save-method for detail.
See
galleryfield.image_views.BuiltInImageCreateView
for example.
- class galleryfield.image_views.ImageListView(**kwargs)[source]
The Class-based view for fetching the existing images of the gallery instance.
- target_model
When not set, defaults to
garllery_widget.BuiltInGalleryImage
- crop_url_name
When
disable_server_side_crop
is False, ifNone
or an invalid URL name will raise anImproperlyConfigured
error.
- disable_server_side_crop
Defaults to
False
- class galleryfield.image_views.ImageCropView(**kwargs)[source]
The Class-based view handling server side cropping of an image model instance.
- target_model
When not set, defaults to
garllery_widget.BuiltInGalleryImage
- crop_url_name
When
disable_server_side_crop
is False, ifNone
or an invalid URL name will raise anImproperlyConfigured
error.
- disable_server_side_crop
Defaults to
False