fobi.contrib.plugins.form_elements.content.content_image package¶
Submodules¶
fobi.contrib.plugins.form_elements.content.content_image.apps module¶
fobi.contrib.plugins.form_elements.content.content_image.conf module¶
-
fobi.contrib.plugins.form_elements.content.content_image.conf.
get_setting
(setting, override=None)[source]¶ Get setting.
Get a setting from
fobi.contrib.plugins.form_elements.content.content_image
conf module, falling back to the default.If override is not None, it will be used instead of the setting.
Parameters: - setting – String with setting name
- override – Value to use when no setting is available. Defaults to None.
Returns: Setting value.
fobi.contrib.plugins.form_elements.content.content_image.defaults module¶
fobi.contrib.plugins.form_elements.content.content_image.fobi_form_elements module¶
-
class
fobi.contrib.plugins.form_elements.content.content_image.fobi_form_elements.
ContentImagePlugin
(user=None)[source]¶ Bases:
fobi.base.FormElementPlugin
Content image plugin.
-
clone_plugin_data
(entry)[source]¶ Clone plugin data.
Clone plugin data, which means we make a copy of the original image.
TODO: Perhaps rely more on data of
form_element_entry
?
-
form
¶ alias of
ContentImageForm
-
group
= <django.utils.functional.__proxy__ object>¶
-
name
= <django.utils.functional.__proxy__ object>¶
-
uid
= 'content_image'¶
-
fobi.contrib.plugins.form_elements.content.content_image.forms module¶
-
class
fobi.contrib.plugins.form_elements.content.content_image.forms.
ContentImageForm
(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]¶ Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
ContentImagePlugin
.-
base_fields
= OrderedDict([('file', <django.forms.fields.ImageField object at 0x7f274d8926d0>), ('alt', <django.forms.fields.CharField object at 0x7f274d892710>), ('fit_method', <django.forms.fields.ChoiceField object at 0x7f274d8927d0>), ('size', <django.forms.fields.ChoiceField object at 0x7f274d892890>)])¶
-
declared_fields
= OrderedDict([('file', <django.forms.fields.ImageField object at 0x7f274d8926d0>), ('alt', <django.forms.fields.CharField object at 0x7f274d892710>), ('fit_method', <django.forms.fields.ChoiceField object at 0x7f274d8927d0>), ('size', <django.forms.fields.ChoiceField object at 0x7f274d892890>)])¶
-
media
¶
-
plugin_data_fields
= [('file', ''), ('alt', ''), ('fit_method', 'center'), ('size', '500x500')]¶
-
fobi.contrib.plugins.form_elements.content.content_image.helpers module¶
-
fobi.contrib.plugins.form_elements.content.content_image.helpers.
handle_uploaded_file
(image_file)[source]¶ Handle uploaded file.
Parameters: image_file (django.core.files.uploadedfile.InMemoryUploadedFile) – Return string: Path to the image (relative).
-
fobi.contrib.plugins.form_elements.content.content_image.helpers.
get_crop_filter
(fit_method)[source]¶ Get crop filter.
-
fobi.contrib.plugins.form_elements.content.content_image.helpers.
delete_file
(image_file)[source]¶ Delete file from disc.
fobi.contrib.plugins.form_elements.content.content_image.settings module¶
FIT_METHOD_CROP_SMART
(string)FIT_METHOD_CROP_CENTER
(string)FIT_METHOD_CROP_SCALE
(string)FIT_METHOD_FIT_WIDTH
(string)FIT_METHOD_FIT_HEIGHT
(string)DEFAULT_FIT_METHOD
(string)FIT_METHODS_CHOICES
(tuple)FIT_METHODS_CHOICES_WITH_EMPTY_OPTION
(list)IMAGES_UPLOAD_DIR
(string)