mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-10 22:03:09 +00:00
prepare 0.5.18; minor improvements
This commit is contained in:
parent
de2ebae999
commit
d3eb80e190
43 changed files with 54 additions and 48 deletions
|
|
@ -15,6 +15,13 @@ are used for versioning (schema follows below):
|
|||
0.3.4 to 0.4).
|
||||
- All backwards incompatible changes are mentioned in this document.
|
||||
|
||||
0.5.18
|
||||
------
|
||||
2015-12-08
|
||||
|
||||
- Minor improvements. Adding request to the `get_form_field_instances` method
|
||||
of the `FormElementPlugin`.
|
||||
|
||||
0.5.17
|
||||
------
|
||||
2015-10-22
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ Defining the Sample textarea plugin.
|
|||
form = SampleTextareaForm
|
||||
group = "Samples" # Group to which the plugin belongs to
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
kwargs = {
|
||||
'required': self.data.required,
|
||||
'label': self.data.label,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class RadioInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = RadioInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class SelectModelObjectInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SelectModelObjectInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class SampleTextareaPlugin(FormFieldPlugin):
|
|||
form = SampleTextareaForm
|
||||
group = "Samples" # Group to which the plugin belongs to
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
kwargs = {
|
||||
'required': self.data.required,
|
||||
'label': self.data.label,
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -69,7 +69,7 @@ for static_dir in static_dirs:
|
|||
for locale_dir in locale_dirs:
|
||||
locale_files += [os.path.join(locale_dir, f) for f in os.listdir(locale_dir)]
|
||||
|
||||
version = '0.5.17'
|
||||
version = '0.5.18'
|
||||
|
||||
install_requires = [
|
||||
'Pillow>=2.0.0',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
__title__ = 'django-fobi'
|
||||
__version__ = '0.5.17'
|
||||
__build__ = 0x000046
|
||||
__version__ = '0.5.18'
|
||||
__build__ = 0x000047
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2015 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
|
|
|
|||
|
|
@ -1151,7 +1151,9 @@ class FormElementPlugin(BasePlugin):
|
|||
# methods in plugins). In DEBUG mode raise an exception if something
|
||||
# goes wrong. Otherwise - skip the element.
|
||||
try:
|
||||
form_field_instances = self.get_form_field_instances()
|
||||
form_field_instances = self.get_form_field_instances(
|
||||
request=request
|
||||
)
|
||||
except AttributeError as e:
|
||||
if DEBUG:
|
||||
raise e
|
||||
|
|
@ -1230,14 +1232,11 @@ class FormElementPlugin(BasePlugin):
|
|||
|
||||
return processed_field_instances
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Gets the instances of form fields, that plugin contains.
|
||||
|
||||
:param fobi.models.FormElementEntry form_element_entry: Instance.
|
||||
:param string origin:
|
||||
:param callable kwargs_update_func:
|
||||
:param callable return_func:
|
||||
:param django.http.HttpRequest request:
|
||||
:return list: List of Django form field instances.
|
||||
|
||||
:example:
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class ContentImagePlugin(FormElementPlugin):
|
|||
)
|
||||
return self.get_cloned_plugin_data(update={'file': cloned_image})
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class ContentTextPlugin(FormElementPlugin):
|
|||
"""
|
||||
self.data.name = "{0}_{1}".format(self.uid, uuid4())
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ContentVideoPlugin(FormElementPlugin):
|
|||
"""
|
||||
self.data.name = "{0}_{1}".format(self.uid, uuid4())
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class BooleanSelectPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = BooleanSelectForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class CheckboxSelectMultipleInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = CheckboxSelectMultipleInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class DateInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = DateInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class DateDropDownInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = DateDropDownInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class DateTimeInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = DateTimeInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class DecimalInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = DecimalInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class EmailInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = EmailInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class FileInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = FileInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class FloatInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = FloatInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class HiddenInputPlugin(FormFieldPlugin):
|
|||
form = HiddenInputForm
|
||||
is_hidden = True
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class InputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = InputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class IntegerInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = IntegerInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class IPAddressInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = IPAddressInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class NullBooleanSelectPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = NullBooleanSelectForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class PasswordInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = PasswordInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class RadioInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = RadioInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class RegexInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = RegexInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SelectInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SelectInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class SelectModelObjectInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SelectModelObjectInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class SelectMPTTModelObjectInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SelectMPTTModelObjectInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SelectMultipleInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SelectMultipleInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class SelectMultipleModelObjectsInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SelectMultipleModelObjectsInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class SelectMultipleMPTTModelObjectsInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SelectMultipleMPTTModelObjectsInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class SlugInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = SlugInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class TextInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = TextInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class TextareaPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = TextareaForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class TimeInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = TimeInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class URLInputPlugin(FormFieldPlugin):
|
|||
group = _("Fields")
|
||||
form = URLInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class CaptchaInputPlugin(FormElementPlugin):
|
|||
group = _("Security")
|
||||
form = CaptchaInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class HoneypotInputPlugin(FormElementPlugin):
|
|||
form = HoneypotInputForm
|
||||
is_hidden = True
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class ReCaptchaInputPlugin(FormElementPlugin):
|
|||
group = _("Security")
|
||||
form = ReCaptchaInputForm
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class DummyPlugin(FormElementPlugin):
|
|||
"""
|
||||
self.data.name = "{0}_{1}".format(self.uid, uuid4())
|
||||
|
||||
def get_form_field_instances(self):
|
||||
def get_form_field_instances(self, request=None):
|
||||
"""
|
||||
Get form field instances.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue