mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-14 07:33:10 +00:00
prepare 0.12.20
This commit is contained in:
parent
481c272e66
commit
88cc699315
10 changed files with 65 additions and 16 deletions
|
|
@ -15,6 +15,12 @@ are used for versioning (schema follows below):
|
|||
0.3.4 to 0.4).
|
||||
- All backwards incompatible changes are mentioned in this document.
|
||||
|
||||
0.12.20
|
||||
-------
|
||||
2018-02-24
|
||||
|
||||
- Minor Python 2 fixes.
|
||||
|
||||
0.12.19
|
||||
-------
|
||||
2018-02-21
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@ are used for versioning (schema follows below):
|
|||
0.3.4 to 0.4).
|
||||
- All backwards incompatible changes are mentioned in this document.
|
||||
|
||||
0.12.20
|
||||
-------
|
||||
2018-02-24
|
||||
|
||||
- Minor Python 2 fixes.
|
||||
|
||||
0.12.19
|
||||
-------
|
||||
2018-02-21
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
-r requirements/django_1_9.txt
|
||||
-r requirements/django_1_11.txt
|
||||
2
setup.py
2
setup.py
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from distutils.version import LooseVersion
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
version = '0.12.19'
|
||||
version = '0.12.20'
|
||||
|
||||
# ***************************************************************************
|
||||
# ************************** Python version *********************************
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
__title__ = 'django-fobi'
|
||||
__version__ = '0.12.19'
|
||||
__version__ = '0.12.20'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2018 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ from .settings import (
|
|||
CUSTOM_THEME_DATA,
|
||||
DEBUG,
|
||||
DEFAULT_THEME,
|
||||
FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS,
|
||||
FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS,
|
||||
FAIL_ON_ERRORS_IN_FORM_WIZARD_HANDLER_PLUGINS,
|
||||
FAIL_ON_MISSING_FORM_ELEMENT_PLUGINS,
|
||||
|
|
@ -1665,7 +1666,10 @@ class FormElementPlugin(BasePlugin):
|
|||
if kwargs_update:
|
||||
return kwargs_update
|
||||
except Exception as err:
|
||||
logger.debug(str(err))
|
||||
if FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS:
|
||||
raise err
|
||||
else:
|
||||
logger.error(str(err))
|
||||
return {}
|
||||
|
||||
def _submit_plugin_form_data(self, form_entry, request, form,
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class MailHandlerMixin(object):
|
|||
|
||||
send_mail(
|
||||
safe_text(self.data.subject),
|
||||
"{0}\n\n{1}".format(
|
||||
u"{0}\n\n{1}".format(
|
||||
safe_text(self.data.body),
|
||||
''.join(rendered_data)
|
||||
),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from django.core.files.base import File
|
|||
from django.http import HttpResponse
|
||||
from django.templatetags.static import static
|
||||
from django.test.client import RequestFactory
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.encoding import force_text, smart_text
|
||||
from django.utils.html import format_html_join
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
|
@ -108,10 +108,11 @@ def safe_text(text):
|
|||
|
||||
:return str:
|
||||
"""
|
||||
if PY3:
|
||||
return force_text(text, encoding='utf-8')
|
||||
else:
|
||||
return force_text(text, encoding='utf-8').encode('utf-8')
|
||||
return smart_text(text)
|
||||
# if PY3:
|
||||
# return force_text(text, encoding='utf-8')
|
||||
# else:
|
||||
# return force_text(text, encoding='utf-8').encode('utf-8')
|
||||
|
||||
|
||||
def lists_overlap(sub, main):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# from __future__ import unicode_literals
|
||||
import copy
|
||||
from collections import OrderedDict
|
||||
import datetime
|
||||
|
|
@ -238,6 +239,13 @@ TEST_FORM_ELEMENT_PLUGIN_DATA = {
|
|||
'help_text': "Lorem ipsum text area",
|
||||
'required': True,
|
||||
},
|
||||
|
||||
# Add a "Text" (text input) form element
|
||||
# force_text(TextInputPlugin.name): {
|
||||
# 'label': u"Անուն",
|
||||
# 'help_text': u"Անուն",
|
||||
# 'required': True,
|
||||
# },
|
||||
}
|
||||
|
||||
TEST_FORM_FIELD_DATA = {
|
||||
|
|
@ -266,6 +274,7 @@ TEST_FORM_FIELD_DATA = {
|
|||
'test_text': 'Lorem ipsum',
|
||||
'test_text_area': 'Dolor sit amet',
|
||||
'test_url_input': 'http://dev.example.com',
|
||||
# 'test_unicode_text': u'Անուն',
|
||||
}
|
||||
|
||||
TEST_FORM_HANDLER_PLUGIN_DATA = {
|
||||
|
|
@ -598,7 +607,20 @@ TEST_DYNAMIC_FORMS_DEFINITION_DATA = OrderedDict([
|
|||
'semper lorem rhoncus sem cras amet."'
|
||||
'}'
|
||||
)
|
||||
)
|
||||
),
|
||||
# (
|
||||
# 'unicode_name',
|
||||
# (
|
||||
# TextInputPlugin.uid,
|
||||
# '{'
|
||||
# '"name": "unicode_name", '
|
||||
# '"required": true, '
|
||||
# '"max_length": 200, '
|
||||
# '"label": u"Անուն", '
|
||||
# '"placeholder": u"Անուն"'
|
||||
# '}'
|
||||
# )
|
||||
# ),
|
||||
])
|
||||
|
||||
TEST_DYNAMIC_FORMS_DEFINITION_DATA_DRF = copy.copy(
|
||||
|
|
@ -627,6 +649,7 @@ TEST_DYNAMIC_FORMS_PUT_DATA_ALL = {
|
|||
'special_fields': FAKER.pystr(),
|
||||
'number_of_children': FAKER.pyint(),
|
||||
'bio': FAKER.text(),
|
||||
# 'unicode_name': u'Անուն',
|
||||
}
|
||||
|
||||
TEST_DYNAMIC_FORMS_PUT_DATA = copy.copy(TEST_DYNAMIC_FORMS_PUT_DATA_ALL)
|
||||
|
|
@ -664,5 +687,11 @@ TEST_DYNAMIC_FORMS_OPTIONS_RESPONSE = OrderedDict([
|
|||
(u'bio', OrderedDict([(u'type', u'string'),
|
||||
(u'required', True),
|
||||
(u'read_only', False),
|
||||
(u'label', u'Biography')]))
|
||||
(u'label', u'Biography')])),
|
||||
# (u'unicode_name', OrderedDict([(u'type', u'string'),
|
||||
# (u'required', True),
|
||||
# (u'read_only', False),
|
||||
# (u'label', u'Անուն'),
|
||||
# (u'max_length', 200),
|
||||
# (u'placeholder', u'Անուն')])),
|
||||
])
|
||||
|
|
|
|||
|
|
@ -258,7 +258,6 @@ def get_user_plugins_grouped(get_allowed_plugin_uids_func,
|
|||
|
||||
ordered_registered_plugins = OrderedDict()
|
||||
for key, prop in sorted(registered_plugins.items()):
|
||||
import ipdb; ipdb.set_trace()
|
||||
if sort_by_value:
|
||||
ordered_registered_plugins[key] = sorted(prop, key=lambda t: t[1])
|
||||
else:
|
||||
|
|
@ -610,13 +609,17 @@ def append_edit_and_delete_links_to_field(form_element_plugin,
|
|||
help_text = ''
|
||||
|
||||
data_dict = {
|
||||
'help_text': "{0} {1}".format(help_text, help_text_extra),
|
||||
'help_text': u"{0} {1}".format(help_text, help_text_extra),
|
||||
}
|
||||
|
||||
label = safe_text(getattr(form_element_plugin.data, 'label', ''))
|
||||
data_dict.update(
|
||||
{'label': "{0} ({1})".format(label,
|
||||
safe_text(form_element_plugin.name))}
|
||||
{
|
||||
'label': u"{0} ({1})".format(
|
||||
label,
|
||||
safe_text(form_element_plugin.name)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
# if 'hidden' == form_element_plugin.uid:
|
||||
|
|
|
|||
Loading…
Reference in a new issue