prepare 0.6.8; fixed changing order of the formelement, formelemententry, formhandler and formhandlerentry models

This commit is contained in:
Artur Barseghyan 2016-09-06 22:28:34 +02:00
parent 105ebb6b74
commit fc44cf3230
5 changed files with 63 additions and 9 deletions

View file

@ -16,6 +16,13 @@ are used for versioning (schema follows below):
- All backwards incompatible changes are mentioned in this document.
0.6.8
-----
2016-09-06
- Fixed changing order of the `FormElement`, `FormElementEntry`, `FormHandler`
and `FormHandlerEntry` models.
0.6.7
-----
2016-08-30

View file

@ -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.6.7'
version = '0.6.8'
install_requires = [
'Pillow>=2.0.0',
@ -81,7 +81,7 @@ install_requires = [
'easy-thumbnails>=1.4',
'vishap>=0.1.3,<2.0',
'Unidecode>=0.04.1',
'django-nine>=0.1.6',
'django-nine>=0.1.9',
]
# There are also conditional PY3/PY2 requirements. Scroll down to see them.

View file

@ -1,6 +1,6 @@
__title__ = 'django-fobi'
__version__ = '0.6.7'
__build__ = 0x000050
__version__ = '0.6.8'
__build__ = 0x000051
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2016 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'

View file

@ -1869,11 +1869,14 @@ def assemble_form_field_widget_class(base_class, plugin):
# *********************************** Generic *********************************
# *****************************************************************************
def get_registered_plugins(registry, as_instances=False):
def get_registered_plugins(registry, as_instances=False, sort_items=True):
"""
Gets a list of registered plugins in a form if tuple (plugin name, plugin
description). If not yet autodiscovered, autodiscovers them.
:param registry:
:param bool as_instances:
:param bool sort_items:
:return list:
"""
ensure_autodiscover()
@ -1887,6 +1890,9 @@ def get_registered_plugins(registry, as_instances=False):
plugin_name = safe_text(plugin.name)
registered_plugins.append((uid, plugin_name))
if sort_items:
registered_plugins.sort()
return registered_plugins
def get_registered_plugins_grouped(registry, sort_items=True):
@ -1914,11 +1920,16 @@ def get_registered_plugins_grouped(registry, sort_items=True):
return registered_plugins
def get_registered_plugin_uids(registry, flattern=True):
"""
Gets a list of registered plugin uids as a list . If not yet
autodiscovered, autodiscovers them.
def get_registered_plugin_uids(registry, flattern=True, sort_items=True):
"""Get a list of registered plugin uids as a list .
If not yet auto-discovered, auto-discovers them.
The `sort_items` is applied only if `flattern` is True.
:param registry:
:param bool flattern:
:param bool sort_items:
:return list:
"""
ensure_autodiscover()
@ -1927,6 +1938,8 @@ def get_registered_plugin_uids(registry, flattern=True):
if flattern:
registered_plugin_uids = list(registered_plugin_uids)
if sort_items:
registered_plugin_uids.sort()
return registered_plugin_uids

View file

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('fobi', '0003_auto_20160517_1005'),
]
operations = [
migrations.AlterField(
model_name='formelement',
name='plugin_uid',
field=models.CharField(verbose_name='Plugin UID', unique=True, max_length=255, editable=False, choices=[(b'boolean', b'Boolean'), (b'checkbox_select_multiple', b'Checkbox select multiple'), (b'content_image', b'Content image'), (b'content_text', b'Content text'), (b'content_video', b'Content video'), (b'date', b'Date'), (b'date_drop_down', b'Date drop down'), (b'datetime', b'DateTime'), (b'decimal', b'Decimal'), (b'dummy', b'Dummy'), (b'email', b'Email'), (b'file', b'File'), (b'float', b'Float'), (b'hidden', b'Hidden'), (b'honeypot', b'Honeypot'), (b'input', b'Input'), (b'integer', b'Integer'), (b'ip_address', b'IP address'), (b'null_boolean', b'Null boolean'), (b'password', b'Password'), (b'radio', b'Radio'), (b'regex', b'Regex'), (b'select', b'Select'), (b'select_model_object', b'Select model object'), (b'select_multiple', b'Select multiple'), (b'select_multiple_model_objects', b'Select multiple model objects'), (b'select_multiple_with_max', b'Select multiple with max'), (b'slug', b'Slug'), (b'text', b'Text'), (b'textarea', b'Textarea'), (b'time', b'Time'), (b'url', b'URL')]),
),
migrations.AlterField(
model_name='formelemententry',
name='plugin_uid',
field=models.CharField(max_length=255, verbose_name='Plugin name', choices=[(b'boolean', b'Boolean'), (b'checkbox_select_multiple', b'Checkbox select multiple'), (b'content_image', b'Content image'), (b'content_text', b'Content text'), (b'content_video', b'Content video'), (b'date', b'Date'), (b'date_drop_down', b'Date drop down'), (b'datetime', b'DateTime'), (b'decimal', b'Decimal'), (b'dummy', b'Dummy'), (b'email', b'Email'), (b'file', b'File'), (b'float', b'Float'), (b'hidden', b'Hidden'), (b'honeypot', b'Honeypot'), (b'input', b'Input'), (b'integer', b'Integer'), (b'ip_address', b'IP address'), (b'null_boolean', b'Null boolean'), (b'password', b'Password'), (b'radio', b'Radio'), (b'regex', b'Regex'), (b'select', b'Select'), (b'select_model_object', b'Select model object'), (b'select_multiple', b'Select multiple'), (b'select_multiple_model_objects', b'Select multiple model objects'), (b'select_multiple_with_max', b'Select multiple with max'), (b'slug', b'Slug'), (b'text', b'Text'), (b'textarea', b'Textarea'), (b'time', b'Time'), (b'url', b'URL')]),
),
migrations.AlterField(
model_name='formhandler',
name='plugin_uid',
field=models.CharField(verbose_name='Plugin UID', unique=True, max_length=255, editable=False, choices=[(b'db_store', b'DB store'), (b'http_repost', b'HTTP Repost'), (b'mail', b'Mail')]),
),
migrations.AlterField(
model_name='formhandlerentry',
name='plugin_uid',
field=models.CharField(max_length=255, verbose_name='Plugin name', choices=[(b'db_store', b'DB store'), (b'http_repost', b'HTTP Repost'), (b'mail', b'Mail')]),
),
]