diff --git a/.gitignore b/.gitignore index c0295321..2f99bed1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ ghostdriver.log /dev.db /.cache/ /htmlcov/ +/third_party/ *.py,cover /.idea/ codebin.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ae236e9c..f038ce09 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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.11.12 +------- +2017-05-31 + +- Added a lot of field metadata to the OPTIONS call of ``drf_integration`` app. +- Appended a lot of sub-module README files to the main documentation. + 0.11.11 ------- 2017-05-29 diff --git a/README.rst b/README.rst index a3b9db7b..7097a9c8 100644 --- a/README.rst +++ b/README.rst @@ -18,9 +18,7 @@ Present Note, that Django 1.11 is not yet proclaimed to be flawlessly supported. The core and contrib packages have been tested against the Django 1.11. All tests have successfully passed, although it's yet too early -to claim that Django 1.11 is fully supported. Certain dependencies -(``django-formtools``) have been installed from source (since versions -supporting Django 1.11 are not yet released on PyPI.) +to claim that Django 1.11 is fully supported. Past ---- @@ -2324,6 +2322,34 @@ PhantomJS. If you want to use Firefox for testing, remove or comment-out the ``PHANTOM_JS_EXECUTABLE_PATH`` setting. +Writing documentation +===================== +Keep the following hierarchy. + +.. code-block:: text + + ===== + title + ===== + + header + ====== + + sub-header + ---------- + + sub-sub-header + ~~~~~~~~~~~~~~ + + sub-sub-sub-header + ################## + + sub-sub-sub-sub-header + ^^^^^^^^^^^^^^^^^^^^^^ + + sub-sub-sub-sub-sub-header + ++++++++++++++++++++++++++ + Troubleshooting =============== If you get a ``FormElementPluginDoesNotExist`` or a diff --git a/TODOS.rst b/TODOS.rst index 9301f370..db585f47 100644 --- a/TODOS.rst +++ b/TODOS.rst @@ -81,6 +81,9 @@ Roadmap Uncategorised ------------- +- Somehow PyPy started to fail under Django 1.10 and 1.11 (invocation error), + so it must be some package incompatibility/installation problems. Find out + why. - Think of moving the translation strings from in stored-in=database level to lazily-translated level (so that in some plugins, for instance - in database translations happen lazily). For mail plugin that should not be the case, diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 100644 index 00000000..ae236e9c --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1,1367 @@ +Release history and notes +========================= +`Sequence based identifiers +`_ +are used for versioning (schema follows below): + +.. code-block:: text + + major.minor[.revision] + +- It's always safe to upgrade within the same minor version (for example, from + 0.3 to 0.3.4). +- Minor version changes might be backwards incompatible. Read the + release notes carefully before upgrading (for example, when upgrading from + 0.3.4 to 0.4). +- All backwards incompatible changes are mentioned in this document. + +0.11.11 +------- +2017-05-29 + +- Minor fixes in ``content_text`` ``drf_integration`` plugin. +- Added ``imageurl`` support to the ``mailchimp_impoter`` plugin. + +0.11.10 +------- +2017-05-26 + +- Minor fixes in form-wizards on Django 1.11. + +0.11.9 +------ +2017-05-24 + +- Mezzanine integration updated to work with Mezzanine 4.2.3. +- Fixes in date-drop-down plugin when using form wizards. + +0.11.8 +------ +2017-05-17 + +- ``ContentImageURL`` plugin added. +- Minor Python3 fixes in ``db_store`` plugin (related to export of forms to + ``xls`` format). + +0.11.7 +------ +2017-05-16 + +- Fixed in ``fobi.integration`` package related to Django 1.10 and higher. +- FeinCMS integration updated (only migrations added) to work with + FeinCMS 1.13.2. +- DjangoCMS integration updated to work with DjangoCMS 3.4.3. + +0.11.6 +------ +2017-05-15 + +- Minor fixes in ``drf_integration`` app, added GET/detail actions tests. + +0.11.5 +------ +2017-05-15 + +- Added ``date_drop_down`` to ``drf_integration`` app. +- Fixed dependencies issue. +- Added dedicated requirements for specific Django versions. + +0.11.4 +------ +2017-05-12 + +- Minor fixes in integration callbacks of the ``drf_integration`` sub-package. +- Added support for ``content_image``, ``content_text`` and ``content_video`` + plugins. +- Fixes in installable demo. + +0.11.3 +------ +2017-05-10 + +- Concept of integration callbacks introduced and implemented for the + ``drf_integration`` sub-package. + +0.11.2 +------ +2017-05-09 + +- Minor fixes in ``drf_integration`` app. + +0.11.1 +------ +2017-05-08 + +- Minor fixes in ``decimal`` plugin. +- Minor documentation improvements. + +0.11 +---- +2017-05-07 + +This release is dedicated to my beloved `wife `_ +for all the love and support she gave me through years. If you are a company +looking for (female) developers in Groningen area (the Netherlands), do not +hesitate to `contact her `_. + +- Django REST framework integration. Check the Heroku demo `here + `_. +- Documentation fixes. +- PEP8 code fixes. +- Minor setup fixes related to moved screen-shots file. +- Added helper scripts to test with Firefox in headless mode. Describe + testing with Firefox in headless mode in documentation. +- Validate the ``decimal`` field plugin - quantize the decimal value to the + configured precision. +- Minor fixes in the ``float`` field plugin. +- Minor improvements in complex form element plugins (``select``, ``file``) and + form handler plugins (``db_store``, ``mail``, ``http_respost``) in order to + simplify integration plugins and reduce code duplication. +- Minor Python3 fixes in ``range_select`` and ``slider`` form element plugins. +- Minor Python3 fixes in ``http_repost`` and ``mail`` form handler plugins. + +0.10.7 +------ +2017-03-13 + +- Several Django deprecation/moves fixes for better future compatibility. + +0.10.6 +------ +2017-02-14 + +- Minor Python 3 fixes for integer, float and decimal fields. + +0.10.5 +------ +2017-02-13 + +- Tested against Python 3.6. +- Initial (experimental) Django 1.11 support. + +0.10.4 +------ +2017-01-11 + +- Minor fixes in Django admin. +- Various pep8 fixes. +- Fixes additions and improvements in/of docs. +- Add options to test with PhantomJS instead of Firefox. + +0.10.3 +------ +2016-11-24 + +- Minor fixes. + +0.10.2 +------ +2016-11-24 + +- Minor fixes. + +0.10.1 +------ +2016-11-17 + +- Fixed captcha and re-captcha issues in form wizards. + +0.10 +---- +2016-11-16 + +Note, that this release contains minor backwards incompatible changes, that may +break your code. Two additional arguments have been added to the +`submit_plugin_form_data` method of the form element plugins. If you have +written custom form element plugins - update your code. + +- Added `form_entry_elements` and `kwargs` to the `submit_plugin_form_data` + method of the form element plugins. Make sure to update your custom + plugins if you have written any. +- Added tests for mailchimp integration plugin. +- Moving all plugins to base submodules of the correspondent sub + packages. +- Add missing whitespace to the ``help_text`` of the ``title`` field of + ``FormEntry`` and ``FormWizardEntry`` models. +- Disable GoogleAnalytics while testing (guess what - this change speeds up + selenium tests twice). +- Docs updated. +- Helper scripts updated. +- Multiple pep8 fixes. + +0.9.17 +------ +2016-11-13 + +Announcing dropping support of Python 2.6 and Django 1.7. As of 0.9.17 +everything is still backwards compatible with Django 1.7, but in future +versions it will be wiped out. + +- Value validations for Integer and Text Fields. +- Hide previous button in form wizard template for bootstrap3 on first step. + +0.9.16 +------ +2016-11-10 + +- Introduced form titles (shown in view templates). +- Improved navigation of the form wizards. + +0.9.15 +------ +2016-11-07 + +- Minor fixes. + +0.9.14 +------ +2016-11-07 + +- Minor fixes. + +0.9.13 +------ +2016-11-05 + +Announcing dropping support of Django 1.5 and 1.6. As of 0.9.17 everything is +still backwards compatible with versions 1.5 and 1.6, but in future versions +compatibility with these versions will be wiped out. + +- Fix backwards compatibility of `slider` and `range_select` plugins with + Django versions 1.5 and 1.6. + +0.9.12 +------ +2016-11-02 + +- Better debugging. +- Upgrade example FeinCMS integration to work with 1.12. + +0.9.11 +------ +2016-11-01 + +- Fixes. + +0.9.10 +------ +2016-11-01 + +- Fixed issue with custom labels in the `slider` plugin. +- Made `slider` plugin compatible with Django <= 1.6. +- Fixes `get_absolute_url` methods on `FormEntry` and `FormWizardEntry` + models. #48 + +0.9.9 +----- +2016-10-31 + +- Make it possible to add custom ticks to the `slider` plugin. + +0.9.8 +----- +2016-10-27 + +- Support multiple sliders in one form. + +0.9.7 +----- +2016-10-27 + +- Improvements in the generic integration processor. #47 +- Improved form wizard interface and navigation. +- Fixed a broken test. +- Added import/export functionality for form wizards. + +0.9.6 +----- +2016-10-25 + +- Fixed InvalidQuery exception raised when attempting to export entry from a + 'DB store' handler. #44 +- Fixed ProgrammingError raised when using the 'Export data to CSV/XLS' + action. #45 + +0.9.5 +----- +2016-10-25 + +- Minor fixes in `slider` and `select_range` plugins. + +0.9.4 +----- +2016-10-24 + +- Fix issue with `select_multiple`, `select_multiple_model_objects` and + `select_multiple_mptt_model_objects` being invalidated on the last step + of the form wizard. + +0.9.3 +----- +2016-10-24 + +- Change to `NumberInput` widget for all number inputs. +- Fixed issue with `slider` plugin missing labels if `Show endpoints as` is + set to `Labeled ticks`. +- Link to edit form entry added to edit form wizard entry view. + +0.9.2 +----- +2016-10-24 + +- Minor fixes. + +0.9.1 +----- +2016-10-24 + +- Minor fixes. + +0.9 +--- +2016-10-24 + +Note, that this release contain minor backwards incompatible changes, that +may break your existing code (your data is left intact). If you have written +custom form element plugins you should update your code! + +- The :method:`get_form_field_instances` + and :method:`_get_form_field_instances` of + the :class:`fobi.base.FormElementPlugin` both accept two new optional + arguments: `form_entry` and `form_element_entries` as well as **kwargs. + Make sure to update your custom plugins if you have written any. +- Minor fixes in the form wizards: forms in intermediate steps do receive + updates from the `submit_plugin_form_data` of the plugins. +- Fixed issue in the `base_bulk_change_plugins` function on Django 1.10. + +0.8.10 +------ +2016-10-22 + +- Minor CSS improvements of the `slider` plugin. +- Fixed broken readthedocs requirements. + +0.8.9 +----- +2016-10-22 + +- Simplified debugging (never set `FOBI_DEBUG` to True in production!). +- Major `slider` plugin improvements. + +0.8.8 +----- +2016-10-21 + +- Minor `slider` plugin improvements (JavaScript). + +0.8.7 +----- +2016-10-21 + +- Fixed issue of plugin media not being collected in the form wizard. + +0.8.6 +----- +2016-10-21 + +- Functional improvements of `slider` plugin. + +0.8.5 +----- +2016-10-20 + +- Add `range_select` and `slider` form field plugins. +- Fixed custom CSS classes not appearing in the rendered HTML of the field + plugin/widget. +- Fixed issue with undefined file storage for form wizards. From now on + the `FileSystemStorage` storage is used for wizard uploads. +- Fixed too much of extreme data view/export security of the `db_store` + plugin. +- Backwards compatibility fixes for Django < 1.7. + +0.8.4 +----- +2016-10-19 + +- Fix broken export (to JSON) of form entries. +- Fix broken import (from JSON) of form entries. + +0.8.3 +----- +2016-10-18 + +- Minor fixes. + +0.8.2 +----- +2016-10-18 + +- Minor fixes. + +0.8.1 +----- +2016-10-17 + +- Minor fixes. + +0.8 +--- +2016-10-17 + +Release supported by `Lund University Cognitive Science +`_. + +- Adding form-wizards functionality. Note, that at the moment only + `bootstrap3` theme was updated to filly support the form wizards. Although, + all other themes would by default support form-wizard functionality, they + may not look as nice as they should be (to be fixed in 0.8.x releases + shortly). +- The `six` package requirements increased to >= 1.8. +- Tests comply with pep8. +- Fixed recently broken drag-and-drop ordering of the form elements. +- Fixed typo for HTML id "tab-form-elemenets" -> "tab-form-elements". You + may need to update your custom CSS/JS/HTML accordingly. See the listing + 0.8.a for the files affected. +- An additional property `form_view_form_entry_option_class` has been added + to all the themes. Change your custom CSS/jS/HTML accordingly. See the + listing 0.8.b for the files affected. +- Fixed drag-and-drop not working for ordering of form elements. #43 +- Fixed issue with non-proper rendering of the form-importer templates. + +Although this release does not contain backwards incompatible changes, there +have been several changes in GUI and some parts of the generic HTML and themes +were updated. If you have custom themes implemented, you should likely make +some minor updates to the HTML in order to reflect the latest GUI changes. +The following templates have been affected: + +New files +~~~~~~~~~ +- src/fobi/contrib/plugins/form_handlers/db_store/templates/db_store/view_saved_form_wizard_data_entries.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/add_form_wizard_handler_entry.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/add_form_wizard_handler_entry_ajax.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/create_form_wizard_entry.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/create_form_wizard_entry_ajax.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/edit_form_wizard_entry.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/edit_form_wizard_entry_ajax.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/form_wizards_dashboard.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/snippets/form_wizard_ajax.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/snippets/form_wizard_properties_snippet.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/snippets/form_wizard_snippet.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/view_form_wizard_entry.html +- src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/view_form_wizard_entry_ajax.html +- src/fobi/templates/fobi/generic/add_form_wizard_handler_entry.html +- src/fobi/templates/fobi/generic/add_form_wizard_handler_entry_ajax.html +- src/fobi/templates/fobi/generic/create_form_wizard_entry.html +- src/fobi/templates/fobi/generic/create_form_wizard_entry_ajax.html +- src/fobi/templates/fobi/generic/edit_form_wizard_entry.html +- src/fobi/templates/fobi/generic/edit_form_wizard_entry_ajax.html +- src/fobi/templates/fobi/generic/form_wizard_entry_submitted.html +- src/fobi/templates/fobi/generic/form_wizard_entry_submitted_ajax.html +- src/fobi/templates/fobi/generic/form_wizards_dashboard.html +- src/fobi/templates/fobi/generic/snippets/form_wizard_ajax.html +- src/fobi/templates/fobi/generic/snippets/form_wizard_properties_snippet.html +- src/fobi/templates/fobi/generic/snippets/form_wizard_snippet.html +- src/fobi/templates/fobi/generic/snippets/form_wizard_view_ajax.html +- src/fobi/templates/fobi/generic/view_form_wizard_entry.html +- src/fobi/templates/fobi/generic/view_form_wizard_entry_ajax.html + +Existing files +~~~~~~~~~~~~~~ +- src/fobi/contrib/plugins/form_importers/mailchimp_importer/templates/mailchimp_importer/1.html +- src/fobi/contrib/plugins/form_importers/mailchimp_importer/views.py +- src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html +- src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_entry_ajax.html +- src/fobi/templates/fobi/generic/edit_form_entry_ajax.html + +Additional listings +~~~~~~~~~~~~~~~~~~~ +Listing 0.8.a "tab-form-elemenets" -> "tab-form-elements" +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- src/fobi/contrib/themes/djangocms_admin_style_theme/static/djangocms_admin_style_theme/css/fobi.djangocms_admin_style_theme.edit.css +- src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html +- src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_entry_ajax.html +- src/fobi/contrib/themes/simple/static/simple/css/fobi.simple.edit.css +- src/fobi/contrib/themes/simple/templates/simple/edit_form_entry_ajax.html +- src/fobi/templates/fobi/generic/edit_form_entry_ajax.html +- src/fobi/templates/fobi/generic/edit_form_wizard_entry_ajax.html + +Listing 0.8.b `form_view_form_entry_option_class` property +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- src/fobi/contrib/themes/bootstrap3/fobi_themes.py +- src/fobi/contrib/themes/djangocms_admin_style_theme/fobi_themes.py +- src/fobi/contrib/themes/foundation5/fobi_themes.py +- src/fobi/contrib/themes/simple/fobi_themes.py +- src/fobi/templates/fobi/generic/edit_form_wizard_entry_ajax.html + +0.7.1 +----- +2016-09-22 + +Release sponsored by `Goldmund, Wyldebeast & Wunderliebe +`_. + +- Code comply with pep8. +- Minor fixes in selenium tests. + +0.7 +--- +2016-09-13 + +Release sponsored by `Goldmund, Wyldebeast & Wunderliebe +`_. + +- Initial Django 1.10 support. +- `django-localeurl` has been replaced with `i18n_patterns` in sample project. +- Minor fixes. + +0.6.10 +------ +2016-09-11 + +- Moved `plugin_uid` field choices from model level to form level for + `FormHandler` and `FormHandlerEntry` models. #37 + +0.6.9 +----- +2016-09-08 + +- Moved `plugin_uid` field choices from model level to form level for + `FormElement` and `FormElementEntry` models. #37 +- Fixed element "name" field stripping underscores issue. #33 + +0.6.8 +----- +2016-09-06 + +- Fixed changing order of the `FormElement`, `FormElementEntry`, `FormHandler` + and `FormHandlerEntry` models. + +0.6.7 +----- +2016-08-30 + +- Minor fixes in `db_store` plugin (Django 1.6 compatibility issue). +- Added __str__ methods to models. +- Restrict queryset to form element entries related to the form entry in + position calculation. + +0.6.6 +----- +2016-05-12 + +- Fixed broken dependencies in demos. +- Minor fixes. +- Adding a new `Select multiple with max` plugin, which restricts max number + of choices allowed to be chosen. + +0.6.5 +----- +2015-12-24 + +- Minor fixes. + +0.6.4 +----- +2015-12-24 + +- Minor fixes. + +0.6.3 +----- +2015-12-23 + +- Minor fixes. + +0.6.2 +----- +2015-12-22 + +- Make it possible to render a list of forms using custom template tag (not + only on the dashboard page). + +0.6.1 +----- +2015-12-21 + +- Documentation fixes. + +0.6 +--- +2015-12-18 + +- Form importers (and as a part of it - MailChimp integration, + which would allow to import forms from MailChimp into `django-fobi` using + a user-friendly wizard). +- Improved Django 1.9 support. + +0.5.19 +------ +2015-12-15 + +- New style urls everywhere. + +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 + +- Increased `easy-thumbnails` requirement to >= 2.1 for Python 3, since it was + causing installation errors. +- Increased the `django-nine` requirement to >=0.1.6, since it has better + Python 3 support. + +0.5.16 +------ +2015-10-05 + +- Fixes in migrations on Django 1.7. + +0.5.15 +------ +2015-09-17 + +- Minor fixes. + +0.5.14 +------ +2015-09-13 + +- Add create/update dates to the forms. Adding initial migrations. + +0.5.13 +------ +2015-09-01 + +- Translation fixes. +- Updating Dutch and Russian translations. + +0.5.12 +------ +2015-08-29 + +- Export/import forms into/from JSON. +- Minor UI improvements. Adding "Service" tab in the edit view which contains + links to export form to JSON and delete form. + +Although this release does not contain backwards incompatible changes, there +have been several changes in GUI and some parts of the generic HTML and themes +were updated. If you have custom themes implemented, you should likely make +some minor updates to the HTML in order to reflect the latest GUI changes. +The following templates have been affected: + +New files +~~~~~~~~~ +- src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/import_form_entry.html +- src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/import_form_entry_ajax.html + +- src/fobi/contrib/themes/foundation5/templates/foundation5/import_form_entry.html +- src/fobi/contrib/themes/foundation5/templates/foundation5/import_form_entry_ajax.html + +- src/fobi/contrib/themes/simple/templates/simple/import_form_entry.html +- src/fobi/contrib/themes/simple/templates/simple/import_form_entry_ajax.html + +- src/fobi/templates/fobi/generic/import_form_entry.html +- src/fobi/templates/fobi/generic/import_form_entry_ajax.html + +Existing files +~~~~~~~~~~~~~~ +- src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/dashboard.html +- src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html + +- src/fobi/contrib/themes/foundation5/templates/foundation5/dashboard.html +- src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_entry_ajax.html + +- src/fobi/contrib/themes/simple/templates/simple/dashboard.html +- src/fobi/contrib/themes/simple/templates/simple/edit_form_entry_ajax.html + +- src/fobi/templates/fobi/generic/dashboard.html +- src/fobi/templates/fobi/generic/edit_form_entry_ajax.html + +0.5.11 +------ +2015-08-20 + +- Minor improvements of the dynamic values feature. Forbid usage of django + template tags in initial values. + +0.5.10 +------ +2015-08-18 + +- Minor improvements of the initial dynamic values feature. + +0.5.9 +----- +2015-08-17 + +- Minor fixes in the initial dynamic values feature. + +0.5.8 +----- +2015-08-16 + +- Made it possible to define dynamic initials for form fields. Example initial + dynamic values in the form (like {{ request.path }}). +- Minor fixes/improvements. + +0.5.7 +----- +2015-08-03 + +- Minor Python 3 improvements. + +0.5.6 +----- +2015-07-31 + +- `django-mptt` support through `select_mptt_model_object` and + `select_multiple_mptt_model_objects` plugins. +- Python 3 fixes. + +0.5.5 +----- +2015-06-30 + +- Change the `action` field of the FormEntry into a URL field; check if + action exists. +- `captcha`, `recaptcha` and `honeypot` plugins have been made required + in the form. +- Fix: take default values provided in the `plugin_data_fields` of the plugin + form into consideration. + +0.5.4 +----- +2015-05-21 + +- Minor Django 1.8 fixes. +- Improved texts/translations. + +0.5.3 +----- +2015-05-02 + +- Minor fixes in the `mail + `_ + form handler plugin. + +0.5.2 +----- +2015-04-26 + +- Make it possible to provide multiple `to` email addresses in the `mail + `_ + form handler plugin. +- DateTime picker widget added for Foundation5 theme for `date + `_ + and `datetime + `_ + plugins. +- Added more tests (more plugins tested). + +0.5.1 +----- +2015-04-21 + +- DateTime picker widget added for Bootstrap 3 theme for `date + `_ + and `datetime + `_ + plugins. + +0.5 +--- +2015-04-06 + +Note, that this release contains minor backwards incompatible changes. The +changes may affect your existing forms and data. Read the notes below +carefully. + +- Fixed previously wrongly labeled (in `AppConf`) add-ons/plugins + (`fobi.contrib.plugins.form_handlers.db_store`, + `fobi.contrib.apps.feincms_integration`, + `fobi.contrib.apps.djangocms_integration`, + `fobi.contrib.apps.mezzanine_integration`). Due to the change, you would + likely have to to rename a couple of database tables and update referencies + accordingly. No migrations to solve the issue are included at the moment. + +0.4.36 +------ +2015-04-03 + +- Handle non-ASCII characters content_text form element. + +0.4.35 +------ +2015-03-28 + +- Fixed the issue with `allow_multiple` working incorrectly for form handler + plugins. Fix the `db_store` plugin as well. + +0.4.34 +------ +2015-03-27 + +- Minor fixes in the `Checkbox select multiple` and `Radio` plugins. +- Minified tox tests. + +0.4.33 +------ +2015-03-26 + +- `Checkbox select multiple + `_ + field added. +- Minor improvements (styling) in the Foundation 5 theme. +- Initial configuration for tox tests. +- Clean up requirements (for example setups and tests). + +0.4.32 +------ +2015-03-25 + +- Updated missing parts in the Russian translations. +- Minor API improvements. From now on, the `run` method of form handlers + may return a tuple (bool, mixed). In case of errors it might be (False, err). +- Minor code clean ups. + +0.4.31 +------ +2015-03-23 + +- When path of the uploaded file (plugins) doesn't yet exist, create it, + instaid of failing. + +0.4.30 +------ +2015-03-23 + +- From now on submitted files are sent as attachments in the mail plugin. +- Documentation improvements. Adding information of rendering forms using + `django-crispy-forms` or alternatives. +- Minor fixes. + +0.4.29 +------ +2015-03-20 + +- `Decimal + `_ + field added. +- `Float + `_ + field added. +- `Slug + `_ + field added. +- `IP address + `_ + field added. +- `Null boolean + `_ + field added. +- `Time + `_ + field added. +- From now on using `simplejson` package in favour of `json`, since it can + handle decimal data. +- Minor improvements of the date plugins (`datetime`, `date`). + +0.4.28 +------ +2015-03-13 + +- Fix improperly picked configurations of the + `fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects` + plugin. +- Long identifiers of models can now be safely used in foreign key plugins + (such as + `fobi.contrib.plugins.form_elements.fields.select_model_object_plugin` and + `fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects` + plugins). +- Fixed admin bulk change of the plugins. +- From now it's possible to have some control/configure the following plugins + for the submitted value: + + * fobi.contrib.plugins.form_elements.fields.select_model_object + * fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects + + The only thing needs to be done is to specify the appropriate variable + in the settings module of the project (settings.py). + + * FOBI_FORM_ELEMENT_SELECT_MODEL_OBJECT_SUBMIT_VALUE_AS + * FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MODEL_OBJECTS_SUBMIT_VALUE_AS + + Allowed values are: "val", "repr", "mix". + +0.4.27 +------ +2015-03-12 + +- Temporary allow the `fobi.contrib.plugins.form_handlers.db_store` plugin to + be used multiple times per form, until the bug with not being able to assign + the `db_store` plugin to the form due to incorrect handling of restrictions + (``allow_multiple``) introduced in previous version is properly fixed. +- From now it's possible to have some control/configure the following plugins + for the submitted value: + + * fobi.contrib.plugins.form_elements.fields.radio + * fobi.contrib.plugins.form_elements.fields.select + * fobi.contrib.plugins.form_elements.fields.select_multiple + + The only thing needs to be done is to specify the appropriate variable + in the settings module of the project (settings.py). + + * FOBI_FORM_ELEMENT_RADIO_SUBMIT_VALUE_AS + * FOBI_FORM_ELEMENT_SELECT_SUBMIT_VALUE_AS + * FOBI_FORM_ELEMENT_SELECT_MULTIPLE_SUBMIT_VALUE_AS + + Allowed values are: "val", "repr", "mix". + +0.4.26 +------ +2015-03-06 + +- Validate `fobi.contrib.plugins.form_elements.fields.email`, + `fobi.contrib.plugins.form_elements.fields.integer` and + `fobi.contrib.plugins.form_elements.fields.url` plugins initial values. +- Properly show field types "checkbox" and "radio" in the `input` plugin (as + previously they showed up too large). +- It's now possible to restrict multiple usage of form handler plugins via + ``allow_multiple`` property. In case if it's set to False, the plugin can + be used once only (per form). Default value is True. The `db_store` plugin + is from now on allowed to be used only once (per form). + +0.4.25 +------ +2015-03-04 + +- Post-fix in the discover module (moved logging definition up). + +0.4.24 +------ +2015-03-04 + +- The management command `migrate_03_to_04` intended to migrate 0.3.x branch + data to > 0.4.x branch data, has been renamed to `fobi_migrate_03_to_04`. +- Add missing app config declaration for the `db_store` form handler plugin. +- Add missing app config for the core `fobi` package. +- Improved autodiscover for Django>=1.7. Fix exception when using a dotted + path to an `AppConfig` in `INSTALLED_APPS` (instead of using the path to + the app: ex. "path.to.app.apps.AppConfig" instead of "path.to.app"). + +0.4.23 +------ +2015-03-04 + +- Fix improper initial value validation for Select-like (`radio`, `select` and + `select_multiple`) plugins. + +0.4.22 +------ +2015-03-03 + +- Fix replace system-specific path separator by a slash on file urls. +- Fix empty options appearing in the Select-like (`radio`, `select` and + `select_multiple`) plugins and unified the processing of the raw choices + data. +- Validate the initial value for Select-like (`radio`, `select` and + `select_multiple`) plugins. + +0.4.21 +------ +2015-02-28 + +- The + ``fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects`` + plugin added. + +0.4.20 +------ +2015-02-27 + +- Make it possible to load initial form data from GET variables. +- Remove "button" and "submit" types from ``fobi.contrib.elements.fields.input`` + form element plugin. +- The ``fobi.contrib.plugins.form_elements.fields.select_model_object`` plugin + no longer returns an absolute URL to the admin of the chosen model object + instance. Instead, it contains the app label, model name, pk and the repr + of it separated by dots. Example: "comments.comment.5.Lorem ipsum". +- Minor fixes in ``from fobi.contrib.elements.fields.file`` plugin. Use system + path separator on ``from fobi.contrib.elements.fields.file.FILES_UPLOAD_DIR`` + default setting. +- Minor documentation improvements. + +0.4.19 +------ +2015-02-15 + +- Some more work on future (Django 1.9) compatibility. +- Replace bits of backwards-/forwards- compatibility code with equal code + parts of ``django-nine``. + +0.4.18 +------ +2015-02-13 + +- From now on it's possible to localise (translated) URLs. +- Safe way to get the user model for Django >= 1.5.* <= 1.8.* + +0.4.17 +------ +2015-02-12 + +- Fix circular imports by proper referencing of the user model in + foreign key and many-to-many relations (``settings.AUTH_USER_MODEL`` instead + of ``django.contrib.auth.get_user_model``). +- Minor documentation improvements. + +0.4.16 +------ +2015-02-10 + +- A new theme ``djangocms_admin_style_theme`` added. +- Making ``fobi.fields.NoneField`` always valid. +- Initial work on Django 1.8 and 1.9 support. +- Minor fixes. + +0.4.15 +------ +2015-01-27 + +- Fix the "large" checkboxes in edit mode - now shown small as they should be. + +0.4.14 +------ +2015-01-26 + +- German translations added. + +0.4.13 +------ +2015-01-15 + +- Remove an `ipdb` statement from base integration processor + `fobi.integration.processors.IntegrationProcessor`. +- Added information in the docs about FeinCMS demo part on heroku demo. +- Make sure values of form elements declared not to have a value (``has_value`` + property is set to False) aren't being saved in the ``db_store`` plugin. +- Remove redundant static assets (package size decreased). + +0.4.12 +------ +2015-01-14 + +- Fix empty options appearing in the Select-like plugins and unified the + processing of the raw choices data. +- Update the `vishap` package requirement to latest stable 0.1.3. +- Support for wheel packages. + +0.4.11 +------ +2014-12-29 + +- Styling fixes in the ``radio`` button field of the ``bootstrap3`` theme. +- Fixed ``db_store`` issue with CSV/XLS export failing on Django 1.7. + +0.4.10 +------ +2014-12-28 + +- Minor fixes in FeinCMS integration app. + +0.4.9 +----- +2014-12-28 + +- Third party app integration (at the moment, FeinCMS, DjangoCMS, Mezzanine) + had been generalised and unified. +- Mention the Heroku live demo in the docs. +- Minor CSS fixes in the ``simple`` theme. + +0.4.8 +----- +2014-12-25 + +- More verbose debugging. + +0.4.7 +----- +2014-12-24 + +- Temporary left out the "cloneable" column from the dashboard templates. +- Fixed broken imports in CAPTCHA plugin. +- Fixed broken imports in ReCAPTCHA plugin. + +0.4.6 +----- +2014-12-23 + +- Updated requirements for the ``vishap`` package to avoid the ``six`` version + conflicts. +- Minor documentation fixes. + +0.4.5 +----- +2014-12-17 + +- ReCAPTCHA field added. +- Mezzanine integration app added. +- Remove redundant dependencies (django-tinymce). +- Minor improvements of the discover module. + +0.4.4 +----- +2014-12-06 + +- Documentation improvements. +- Updated Dutch and Russian translations. +- Minor fixes related to lazy translations. + +0.4.3 +----- +2014-12-05 + +- Make sure values of form elements declared not to have a value (``has_value`` + property is set to False) aren't being saved in the ``db_store`` plugin. +- Apply that to the ``honeypot`` and ``captcha`` plugins. + +0.4.2 +----- +2014-12-04 + +- Helper script (management command) in order to migrate django-fobi==0.3.* + data to django-fobi==0.4.* data (caused by renaming the ``birthday`` field + to ``date_drop_down`` - see the release notes of 0.4 below). Follow the steps + precisely in order to painlessly upgrade your django-fobi==0.3.* to + django-fobi==0.4.*: + + 1. Install django-fobi>=0.4.2:: + + pip install django-fobi>=0.4.2 + + 2. In your settings change the:: + + 'fobi.contrib.plugins.form_elements.fields.birthday' + + to:: + + 'fobi.contrib.plugins.form_elements.fields.date_drop_down' + + 3. Run the ``migrate_03_to_04`` management command. Note, that as of version + 0.4.24, the `migrate_03_to_04` command has been renamed to + `fobi_migrate_03_to_04`.:: + + ./manage.py migrate_03_to_04 + +0.4.1 +----- +2014-12-04 + +- Fixes in Foundation5 and Simple themes related to the changes in error + validation/handling of hidden fields. + +0.4 +--- +2014-12-03 + +Note, that this release contains minor backwards incompatible changes. The +changes may affect your existing forms and data. Read the notes below +carefully (UPDATE 2014-12-04: the django-fobi==0.4.2 contains a management +command which makes the necessary changes in the database for safe upgrade). + +- The ``captcha`` field has been moved from + ``fobi.contrib.plugins.form_elements.fields.captcha`` to + ``fobi.contrib.plugins.form_elements.security.captcha``. Make sure to update + the package paths in ``INSTALLED_APPS`` of your projects' settings module + (settings.py) when upgrading to this version. +- The ``honeypot`` field has been added. +- The ``birthday`` field has been renamed to ``date_drop_down`` (A real + ``birthday`` field is still to come in later releases). The change causes + backwards incompatibility issues if you have used that ``birthday`` field. + If you haven't - you have nothing to worry. If you have been using it, + grab the 0.3.4 version, copy the + ``fobi.contrib.plugins.form_elements.fields.date_drop_down`` package to + your project apps, make necessary path changes and update the package paths + in ``INSTALLED_APPS`` settings module (settings.py) before upgrading to this + version. Then, in Django admin management interface, replace all the + occurances of ``Birthday`` field with ``Date drop down`` field. +- Better error validation/handling of hidden fields. A new form snippet + template added for displaying the non-field and hidden fields errors. The new + template makes a part of a standard theme as an attribute + ``form_non_field_and_hidden_errors_snippet_template``. +- Minor fixes in generic templates. +- An additional property ``is_hidden`` added to the hidden form elements. Those + form elements would be getting a default TextInput widget in the edit mode + instead of the widget they come from by default. It's possible to provide an + alternative widget for the edit mode as well. Default value of the + ``is_hidden`` is set to False. + +0.3.4 +----- +2014-11-23 + +- New settings ``FOBI_FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS`` and + ``FOBI_FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS`` introduced. They do as + their name tells. Default value for both is False. +- Fixed exceptions raised when unicode characters were used as form names. +- Fixed exceptions raised when unicode characters were used as field labels. +- Fixes in the `db_store` and `mail` plugins related to usage of unicode + characters. + +0.3.3 +----- +2014-11-22 + +- Clean up the setup. Remove redundant dependencies. +- Documentation improvements. + +0.3.2 +----- +2014-11-20 + +- DjangoCMS integration app made compatible with DjangoCMS 2.4.3. + +0.3.1 +----- +2014-11-19 + +- DjangoCMS integration app. + +0.3 +--- +2014-11-09 + +Note, that this release contains minor backwards incompatible changes. The +changes do not anyhow affect your existing forms or data. The only thing you +need to do is update the app paths in the ``settings`` module of your project. + +- Minor core improvements related to the themeing of the form handler plugins. +- Several presentational form element plugins have been renamed. + The ``fobi.contrib.plugins.form_elements.content.image`` plugin has been + renamed to ``fobi.contrib.plugins.form_elements.content.content_image``. + The ``fobi.contrib.plugins.form_elements.content.text`` plugin has been + renamed to ``fobi.contrib.plugins.form_elements.content.content_text``. + The ``fobi.contrib.plugins.form_elements.content.video`` plugin has been + renamed to ``fobi.contrib.plugins.form_elements.content.content_video``. + If you have used any of the above mentioned plugins, make sure to update + the app paths in the ``settings`` module of your project. +- The ``fobi.contrib.plugins.form_elements.content.dummy`` plugin has been moved + to ``fobi.contrib.plugins.form_elements.test.dummy`` location. If you have + used it, make sure to update the its' path in the ``settings`` module of + your project. +- Added readme to the following content form element plugins: ``dummy``, + ``content_image``, ``content_text`` and ``content_video``. +- Added ``foundation5`` and ``simple`` theme widgets for ``db_store`` plugin. +- If you have been overriding the defaults of the ``db_store`` plugin, change + the prefix from ``FOBI_PLUGIN_DB_EXPORT_`` to ``FOBI_PLUGIN_DB_STORE_``. For + example, ``FOBI_PLUGIN_DB_EXPORT_CSV_DELIMITER`` should become + ``FOBI_PLUGIN_DB_STORE_CSV_DELIMITER``. +- Mentioning the ``fobi_find_broken_entries`` management command in the + documentation, as well as improving the management command itself (more + verbose output). +- Birthday field added. + +0.2.1 +----- +2014-11-06 + +- Minor improvements of the ``db_store`` plugin. +- Minor improvements of the ``simple`` theme. Make sure that custom + form handler actions are properly shown in the form handlers list. +- Make it possible to fail silently on missing form element or form + handler plugins by setting the respected values to False: + ``FOBI_FAIL_ON_MISSING_FORM_ELEMENT_PLUGINS``, + ``FOBI_FAIL_ON_MISSING_FORM_HANDLER_PLUGINS``. Otherwise an appropriate + exception is raised. + +0.2 +--- +2014-11-05 + +Note, that this release contains minor backwards incompatible changes. + +- Minor (backwards incompatible) changes in the form handler plugin API. + From now on both ``custom_actions`` and ``get_custom_actions`` methods + accept ``form_entry`` (obligatory) and ``request`` (optional) arguments. If + you have written your own or have changed existing form handler plugins + with use of one of the above mentioned methods, append those arguments to + the method declarations when upgrading to this version. If you haven't + written your own or changed existing form handler plugins, you may just + upgrade to this version. +- Added data export features to the ``db_store`` plugin. +- Minor fixes in ``db_store`` plugin. +- Added missing documentation for the ``feincms_integration`` app. +- Updated translations for Dutch and Russian. + +0.1.6 +----- +2014-10-25 + +- Minor improvements in the theming API. From now on the + ``view_embed_form_entry_ajax_template`` template would be used + when integrating the form rendering from other products (for example, + a CMS page, which has a widget which references the form object. If + that property is left empty, the ``view_form_entry_ajax_template`` + is used. For a success page the ``embed_form_entry_submitted_ajax_template`` + template would be used. +- Functional improvements of the FeinCMS integration (the widget). If you + have used the FeinCMS widget of earlier versions, you likely want to update + to this one. From now on you can select a custom form title and the button + text, as well as provide custom success page title and the success message; + additionally, it has been made possible to hide the form- or success-page- + titles. + +0.1.5 +----- +2014-10-23 + +- Minor fixes in the ``Integer`` form element plugin. +- Minor fixes in the ``Input`` form element plugin. +- Minor fixes in themes (disable HTML5 form validation in edit mode). +- Minor documentation improvements. + +0.1.4 +----- +2014-10-22 + +- Minor core improvements. +- Django 1.5 support improvements. +- Django 1.7 support improvements. +- Added ``Captcha`` form element plugin. +- Added highly-customisable ``Input`` form element plugin - a custom input field + with support for almost any ever existing HTML attribute. +- Documentation improvements. + +0.1.3 +----- +2014-10-13 + +- Django 1.7 support. +- Add HTML5 "placeholder" field attribute support. + +0.1.2 +----- +2014-10-11 + +- Simple theme fixes: Fix for making the theme work in Django 1.5. + +0.1.1 +----- +2014-10-11 + +- Bootstrap 3 theme fixes: When tab pane has no or little content so + that the height of the dropdown menu exceeds the height of the tab pane + content the dropdown menu now becomes scrollable (vertically). + +0.1 +--- +2014-10-11 + +- Initial release. diff --git a/docs/documentation.rst.distrib b/docs/documentation.rst.distrib index 224b9b5e..8115b2ae 100644 --- a/docs/documentation.rst.distrib +++ b/docs/documentation.rst.distrib @@ -8,6 +8,8 @@ Contents: fobi quickstart + changelog + licenses Indices and tables ================== diff --git a/docs/empty.rst.distrib b/docs/empty.rst.distrib new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/docs/empty.rst.distrib @@ -0,0 +1,2 @@ + + diff --git a/docs/fobi.contrib.apps.djangocms_integration.rst b/docs/fobi.contrib.apps.djangocms_integration.rst index b53915a7..2c1a8a88 100644 --- a/docs/fobi.contrib.apps.djangocms_integration.rst +++ b/docs/fobi.contrib.apps.djangocms_integration.rst @@ -20,6 +20,14 @@ fobi.contrib.apps.djangocms_integration.cms_plugins module :undoc-members: :show-inheritance: +fobi.contrib.apps.djangocms_integration.cms_version module +---------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.djangocms_integration.cms_version + :members: + :undoc-members: + :show-inheritance: + fobi.contrib.apps.djangocms_integration.conf module --------------------------------------------------- diff --git a/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.rst b/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.rst new file mode 100644 index 00000000..2317cda9 --- /dev/null +++ b/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.rst @@ -0,0 +1,38 @@ +fobi.contrib.apps.drf_integration.form_elements.content.content_image_url package +================================================================================= + +Submodules +---------- + +fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.apps module +------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.apps + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.base module +------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.base + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.fobi_integration_form_elements module +--------------------------------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.fobi_integration_form_elements + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_image_url + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_text.rst b/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_text.rst new file mode 100644 index 00000000..328d4426 --- /dev/null +++ b/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_text.rst @@ -0,0 +1,38 @@ +fobi.contrib.apps.drf_integration.form_elements.content.content_text package +============================================================================ + +Submodules +---------- + +fobi.contrib.apps.drf_integration.form_elements.content.content_text.apps module +-------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_text.apps + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.content.content_text.base module +-------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_text.base + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.content.content_text.fobi_integration_form_elements module +---------------------------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_text.fobi_integration_form_elements + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_text + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_video.rst b/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_video.rst new file mode 100644 index 00000000..5faaaeef --- /dev/null +++ b/docs/fobi.contrib.apps.drf_integration.form_elements.content.content_video.rst @@ -0,0 +1,38 @@ +fobi.contrib.apps.drf_integration.form_elements.content.content_video package +============================================================================= + +Submodules +---------- + +fobi.contrib.apps.drf_integration.form_elements.content.content_video.apps module +--------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_video.apps + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.content.content_video.base module +--------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_video.base + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.content.content_video.fobi_integration_form_elements module +----------------------------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_video.fobi_integration_form_elements + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.content.content_video + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/fobi.contrib.apps.drf_integration.form_elements.content.rst b/docs/fobi.contrib.apps.drf_integration.form_elements.content.rst index 92153a1d..289dd4d8 100644 --- a/docs/fobi.contrib.apps.drf_integration.form_elements.content.rst +++ b/docs/fobi.contrib.apps.drf_integration.form_elements.content.rst @@ -7,6 +7,9 @@ Subpackages .. toctree:: fobi.contrib.apps.drf_integration.form_elements.content.content_image + fobi.contrib.apps.drf_integration.form_elements.content.content_image_url + fobi.contrib.apps.drf_integration.form_elements.content.content_text + fobi.contrib.apps.drf_integration.form_elements.content.content_video Module contents --------------- diff --git a/docs/fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.rst b/docs/fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.rst new file mode 100644 index 00000000..d5bfd349 --- /dev/null +++ b/docs/fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.rst @@ -0,0 +1,38 @@ +fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down package +============================================================================= + +Submodules +---------- + +fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.apps module +--------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.apps + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.base module +--------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.base + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.fobi_integration_form_elements module +----------------------------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.fobi_integration_form_elements + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/fobi.contrib.apps.drf_integration.form_elements.fields.rst b/docs/fobi.contrib.apps.drf_integration.form_elements.fields.rst index 44e78cc9..190e4990 100644 --- a/docs/fobi.contrib.apps.drf_integration.form_elements.fields.rst +++ b/docs/fobi.contrib.apps.drf_integration.form_elements.fields.rst @@ -9,6 +9,7 @@ Subpackages fobi.contrib.apps.drf_integration.form_elements.fields.boolean fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple fobi.contrib.apps.drf_integration.form_elements.fields.date + fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down fobi.contrib.apps.drf_integration.form_elements.fields.datetime fobi.contrib.apps.drf_integration.form_elements.fields.decimal fobi.contrib.apps.drf_integration.form_elements.fields.email @@ -26,6 +27,7 @@ Subpackages fobi.contrib.apps.drf_integration.form_elements.fields.select fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple + fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max fobi.contrib.apps.drf_integration.form_elements.fields.slider fobi.contrib.apps.drf_integration.form_elements.fields.slug diff --git a/docs/fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.rst b/docs/fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.rst new file mode 100644 index 00000000..22f47632 --- /dev/null +++ b/docs/fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.rst @@ -0,0 +1,38 @@ +fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects package +============================================================================================ + +Submodules +---------- + +fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.apps module +------------------------------------------------------------------------------------------------ + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.apps + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.base module +------------------------------------------------------------------------------------------------ + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.base + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.fobi_integration_form_elements module +-------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.fobi_integration_form_elements + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/fobi.contrib.apps.drf_integration.rst b/docs/fobi.contrib.apps.drf_integration.rst index 45e2128d..62301edf 100644 --- a/docs/fobi.contrib.apps.drf_integration.rst +++ b/docs/fobi.contrib.apps.drf_integration.rst @@ -28,14 +28,6 @@ fobi.contrib.apps.drf_integration.base module :undoc-members: :show-inheritance: -fobi.contrib.apps.drf_integration.codebin module ------------------------------------------------- - -.. automodule:: fobi.contrib.apps.drf_integration.codebin - :members: - :undoc-members: - :show-inheritance: - fobi.contrib.apps.drf_integration.dynamic module ------------------------------------------------ @@ -60,6 +52,14 @@ fobi.contrib.apps.drf_integration.helpers module :undoc-members: :show-inheritance: +fobi.contrib.apps.drf_integration.metadata module +------------------------------------------------- + +.. automodule:: fobi.contrib.apps.drf_integration.metadata + :members: + :undoc-members: + :show-inheritance: + fobi.contrib.apps.drf_integration.serializers module ---------------------------------------------------- diff --git a/docs/fobi.contrib.plugins.form_elements.content.content_image_url.rst b/docs/fobi.contrib.plugins.form_elements.content.content_image_url.rst new file mode 100644 index 00000000..0560e9a9 --- /dev/null +++ b/docs/fobi.contrib.plugins.form_elements.content.content_image_url.rst @@ -0,0 +1,70 @@ +fobi.contrib.plugins.form_elements.content.content_image_url package +==================================================================== + +Submodules +---------- + +fobi.contrib.plugins.form_elements.content.content_image_url.apps module +------------------------------------------------------------------------ + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url.apps + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.plugins.form_elements.content.content_image_url.base module +------------------------------------------------------------------------ + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url.base + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.plugins.form_elements.content.content_image_url.conf module +------------------------------------------------------------------------ + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url.conf + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.plugins.form_elements.content.content_image_url.defaults module +---------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url.defaults + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.plugins.form_elements.content.content_image_url.fobi_form_elements module +-------------------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url.fobi_form_elements + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.plugins.form_elements.content.content_image_url.forms module +------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url.forms + :members: + :undoc-members: + :show-inheritance: + +fobi.contrib.plugins.form_elements.content.content_image_url.settings module +---------------------------------------------------------------------------- + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url.settings + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: fobi.contrib.plugins.form_elements.content.content_image_url + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/fobi.contrib.plugins.form_elements.content.rst b/docs/fobi.contrib.plugins.form_elements.content.rst index 1e6fb24f..a13e3467 100644 --- a/docs/fobi.contrib.plugins.form_elements.content.rst +++ b/docs/fobi.contrib.plugins.form_elements.content.rst @@ -7,6 +7,7 @@ Subpackages .. toctree:: fobi.contrib.plugins.form_elements.content.content_image + fobi.contrib.plugins.form_elements.content.content_image_url fobi.contrib.plugins.form_elements.content.content_text fobi.contrib.plugins.form_elements.content.content_video diff --git a/docs/fobi.migrations.rst b/docs/fobi.migrations.rst index 8580f06a..21592cd2 100644 --- a/docs/fobi.migrations.rst +++ b/docs/fobi.migrations.rst @@ -108,6 +108,14 @@ fobi.migrations.0013_formwizardentry_show_all_navigation_buttons module :undoc-members: :show-inheritance: +fobi.migrations.0014_auto_20170516_1413 module +---------------------------------------------- + +.. automodule:: fobi.migrations.0014_auto_20170516_1413 + :members: + :undoc-members: + :show-inheritance: + Module contents --------------- diff --git a/docs/index.rst b/docs/index.rst index 35cdbc8a..3cf6119b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,9 +18,7 @@ Present Note, that Django 1.11 is not yet proclaimed to be flawlessly supported. The core and contrib packages have been tested against the Django 1.11. All tests have successfully passed, although it's yet too early -to claim that Django 1.11 is fully supported. Certain dependencies -(``django-formtools``) have been installed from source (since versions -supporting Django 1.11 are not yet released on PyPI.) +to claim that Django 1.11 is fully supported. Past ---- @@ -270,7 +268,7 @@ Or latest stable version from BitBucket: 'fobi.contrib.plugins.form_elements.content.content_text', 'fobi.contrib.plugins.form_elements.content.content_video', - # `django-fobo` form handlers + # `django-fobi` form handlers 'fobi.contrib.plugins.form_handlers.db_store', 'fobi.contrib.plugins.form_handlers.http_repost', 'fobi.contrib.plugins.form_handlers.mail', @@ -2324,6 +2322,34 @@ PhantomJS. If you want to use Firefox for testing, remove or comment-out the ``PHANTOM_JS_EXECUTABLE_PATH`` setting. +Writing documentation +===================== +Keep the following hierarchy. + +.. code-block:: text + + ===== + title + ===== + + header + ====== + + sub-header + ---------- + + sub-sub-header + ~~~~~~~~~~~~~~ + + sub-sub-sub-header + ################## + + sub-sub-sub-sub-header + ^^^^^^^^^^^^^^^^^^^^^^ + + sub-sub-sub-sub-sub-header + ++++++++++++++++++++++++++ + Troubleshooting =============== If you get a ``FormElementPluginDoesNotExist`` or a @@ -2363,7 +2389,7 @@ Create a form View/edit form ~~~~~~~~~~~~~~ Form elements -+++++++++++++ +############# .. [1.3] Edit form - form elements tab active, no elements yet .. image:: _static/bootstrap3/03_edit_form_-_form_elements_tab_active_-_no_elements_yet.png @@ -2385,7 +2411,7 @@ Form elements :scale: 80 % Form handlers -+++++++++++++ +############# .. [1.7] Edit form - form handlers tab active, no handlers yet @@ -2485,6 +2511,8 @@ Contents: fobi quickstart + changelog + licenses Indices and tables ================== diff --git a/docs/licenses.rst b/docs/licenses.rst new file mode 100644 index 00000000..ff12c33f --- /dev/null +++ b/docs/licenses.rst @@ -0,0 +1,182 @@ +======== +Licenses +======== +Below information about third-party packages used in the project is presented. + +Bootstrap3 +========== +http://getbootstrap.com/ + +Licensing information: + +- Apache license 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + +Bootstrap 3 DateTime picker +=========================== +http://eonasdan.github.io/bootstrap-datetimepicker/ + +- MIT (http://opensource.org/licenses/mit-license.html) + +bootstrap-slider +================ +https://github.com/seiyria/bootstrap-slider + +- MIT (http://opensource.org/licenses/mit-license.html) + +django-autoslug +=============== +https://bitbucket.org/neithere/django-autoslug + +Licensing information: + +- LGPL 3 (https://www.gnu.org/licenses/lgpl.html) + +django-formtools +================ +https://github.com/django/django-formtools + +Licensing information: + +- BSD (http://opensource.org/licenses/BSD-3-Clause) + +django-nine +=========== +https://github.com/barseghyanartur/django-nine + +Licensing information: + +- GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) +- LGPL 2.1 (https://www.gnu.org/licenses/lgpl-2.1.html) + +django-nonefield +================ +https://github.com/barseghyanartur/django-nonefield + +Licensing information: + +- GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) +- LGPL 2.1 (https://www.gnu.org/licenses/lgpl-2.1.html) + +easy-thumbnails +=============== +https://github.com/SmileyChris/easy-thumbnails + +Licensing information: + +- BSD (http://opensource.org/licenses/BSD-3-Clause) + +Font-awesome +============ +http://fontawesome.io/ + +Licensing information: + +- http://fontawesome.io/license/ +- SIL OFL 1.1 (http://scripts.sil.org/OFL) +- MIT (http://opensource.org/licenses/mit-license.html) + +Foundation 5 +============ +http://foundation.zurb.com/ + +Licensing information: + +- MIT (http://opensource.org/licenses/mit-license.html) + +Foundation 5 DateTime picker +============================ +https://github.com/aliibrahim/foundation-datetimepicker-rails + +Licensing information: + +- MIT (http://opensource.org/licenses/mit-license.html) + +jQuery Colorbox +=============== +http://www.jacklmoore.com/colorbox/ + +Licensing information: + +- MIT (http://www.opensource.org/licenses/mit-license.php) + +jQuery +====== +https://jquery.org + +Licensing information: + +- https://jquery.org/license/ +- MIT (http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) + +jQueryUI +======== +http://jqueryui.com/ + +Licensing information: + +- MIT (https://github.com/jquery/jquery-ui/blob/master/MIT-LICENSE.txt) + +jQuery-Slugify-Plugin +===================== +https://github.com/pmcelhaney/jQuery-Slugify-Plugin + +Licensing information: + +- BSD (https://github.com/pmcelhaney/jQuery-Slugify-Plugin/blob/master/LICENSE). + +moment.js +========= +http://momentjs.com/ + +Licensing information: + +- MIT (http://opensource.org/licenses/mit-license.html) + +ordereddict +=========== +https://pypi.python.org/pypi/ordereddict + +Licensing information: + +- MIT (http://opensource.org/licenses/mit-license.html) + +Pillow +====== +http://python-pillow.github.io/ + +Licensing information: + +- Python Imaging Library license (http://www.pythonware.com/products/pil/) + +Requests +======== +https://python-requests.org + +Licensing information: + +- MIT (http://opensource.org/licenses/mit-license.html) + +Six +=== +https://bitbucket.org/gutworth/six/ + +Licensing information: + +- Apache 2.0 (http://opensource.org/licenses/Apache-2.0) + +Unidecode +========= +https://pypi.python.org/pypi/Unidecode + +Licensing information: + +- GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) + +vishap +====== +https://pypi.python.org/pypi/vishap + +Licensing information: + +- GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) +- LGPL 2.1 (https://www.gnu.org/licenses/lgpl-2.1.html) diff --git a/docs/screenshots.rst.distrib b/docs/screenshots.rst.distrib index c72bd5de..6e48cb14 100644 --- a/docs/screenshots.rst.distrib +++ b/docs/screenshots.rst.distrib @@ -20,7 +20,7 @@ Create a form View/edit form ~~~~~~~~~~~~~~ Form elements -+++++++++++++ +############# .. [1.3] Edit form - form elements tab active, no elements yet .. image:: _static/bootstrap3/03_edit_form_-_form_elements_tab_active_-_no_elements_yet.png @@ -42,7 +42,7 @@ Form elements :scale: 80 % Form handlers -+++++++++++++ +############# .. [1.7] Edit form - form handlers tab active, no handlers yet diff --git a/docs/submodules.rst.distrib b/docs/submodules.rst.distrib new file mode 100644 index 00000000..82837bea --- /dev/null +++ b/docs/submodules.rst.distrib @@ -0,0 +1,4 @@ +(Sub)modules +============ +Some additional documentation on ``django-fobi`` sub-modules are listed +below. diff --git a/examples/saved_forms_in_json_format/test-drf-form.json b/examples/saved_forms_in_json_format/test-drf-form.json new file mode 100644 index 00000000..41239c7f --- /dev/null +++ b/examples/saved_forms_in_json_format/test-drf-form.json @@ -0,0 +1 @@ +{"form_elements": [{"plugin_data": "{\"placeholder\": \"\", \"min_value\": 1, \"required\": false, \"label\": \"Test integer\", \"help_text\": \"\", \"max_value\": 20, \"name\": \"test_integer\", \"initial\": 10}", "plugin_uid": "integer", "position": 1}, {"plugin_data": "{\"initial\": \"\", \"max_length\": 255, \"placeholder\": \"john@doe.com\", \"help_text\": \"Donec mollis hendrerit risus. Phasellus a est. Nam ipsum risus, rutrum vitae, vestibulum eu, molestie vel, lacus. Praesent nec nisl a purus blandit viverra. Cras id dui.\", \"label\": \"Test email\", \"name\": \"test_email\", \"required\": true}", "plugin_uid": "email", "position": 2}, {"plugin_data": "{\"initial\": \"\", \"max_length\": 255, \"placeholder\": \"Lorem ipsum dolor sit amet\", \"help_text\": \"Sed lectus. Phasellus gravida semper nisi. Curabitur at lacus ac velit ornare lobortis. Mauris turpis nunc, blandit et, volutpat molestie, porta ut, ligula. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\", \"label\": \"Test text\", \"name\": \"test_text\", \"required\": false}", "plugin_uid": "text", "position": 3}, {"plugin_data": "{\"initial\": \"http://github.com\", \"max_length\": 255, \"placeholder\": \"\", \"help_text\": \"\", \"label\": \"Test URL\", \"name\": \"test_url\", \"required\": false}", "plugin_uid": "url", "position": 4}, {"plugin_data": "{\"initial\": 10, \"required\": false, \"max_value\": 25, \"label\": \"Test decimal field\", \"decimal_places\": 2, \"name\": \"test_decimal_field\", \"placeholder\": \"3.14\", \"min_value\": 1, \"max_digits\": 5, \"help_text\": \"\"}", "plugin_uid": "decimal", "position": 5}, {"plugin_data": "{\"placeholder\": \"\", \"min_value\": 1.0, \"required\": false, \"label\": \"Test float field\", \"help_text\": \"\", \"max_value\": 10.0, \"name\": \"test_float_field\", \"initial\": 3.14}", "plugin_uid": "float", "position": 6}, {"plugin_data": "{\"placeholder\": \"127,0.0.1\", \"unpack_ipv4\": false, \"label\": \"Test IP address\", \"protocol\": \"ipv6\", \"help_text\": \"\", \"required\": false, \"name\": \"test_ip_address\", \"max_length\": 255, \"initial\": \"\"}", "plugin_uid": "ip_address", "position": 7}, {"plugin_data": "{\"placeholder\": \"your-secret-password\", \"label\": \"Test password field\", \"help_text\": \"\", \"required\": false, \"name\": \"test_password_field\", \"max_length\": 255, \"initial\": \"\"}", "plugin_uid": "password", "position": 8}, {"plugin_data": "{\"placeholder\": \"\", \"label\": \"Test regex field\", \"regex\": \"^([a-zA-Z])+$\", \"help_text\": \"\", \"required\": false, \"name\": \"test_regex_field\", \"max_length\": 255, \"initial\": \"\"}", "plugin_uid": "regex", "position": 9}, {"plugin_data": "{\"placeholder\": \"lorem-ipsum-dolor-sit-amet\", \"label\": \"Test slug field\", \"help_text\": \"\", \"required\": false, \"name\": \"test_slug_field\", \"max_length\": 255, \"initial\": \"\"}", "plugin_uid": "slug", "position": 10}, {"plugin_data": "{\"placeholder\": \"Pellentesque habitant morbi tristique.\", \"label\": \"Test textarea field\", \"help_text\": \"\", \"required\": false, \"name\": \"test_textarea_field\", \"initial\": \"\"}", "plugin_uid": "textarea", "position": 11}, {"plugin_data": "{\"pattern_value\": \"\", \"readonly_value\": true, \"autofocus_value\": true, \"type_value\": \"text\", \"autocomplete_value\": true, \"max_value\": \"\", \"name\": \"test_input_field\", \"step_value\": null, \"placeholder\": \"\", \"min_value\": \"\", \"multiple_value\": false, \"disabled_value\": true, \"label\": \"Test input field\", \"list_value\": \"\", \"help_text\": \"\", \"required\": false, \"max_length\": 255, \"initial\": \"\"}", "plugin_uid": "input", "position": 12}, {"plugin_data": "{\"alt\": \"n.n.\", \"fit_method\": \"fit_width\", \"size\": \"600x600\", \"url\": \"http://delusionalinsanity.com/foreverchild.for.cats/uploads/gallery/2012-11-22-9-1-22.jpg\"}", "plugin_uid": "content_image_url", "position": 14}, {"plugin_data": "{\"text\": \"Pellentesque posuere. Quisque id mi. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Phasellus a est. In turpis.\"}", "plugin_uid": "content_text", "position": 15}, {"plugin_data": "{\"title\": \"Delusional Insanity - To far beyond...\", \"size\": \"500x400\", \"url\": \"https://www.youtube.com/watch?v=8GVIui0JK0M&t=1s\"}", "plugin_uid": "content_video", "position": 16}], "form_handlers": [], "name": "Test DRF form", "is_cloneable": false, "success_page_message": "", "is_public": false, "success_page_title": "", "action": "", "slug": "test-drf-form"} \ No newline at end of file diff --git a/scripts/build_docs.sh b/scripts/build_docs.sh index 020b17da..58c42581 100755 --- a/scripts/build_docs.sh +++ b/scripts/build_docs.sh @@ -1,7 +1,285 @@ #./scripts/uninstall.sh #./scripts/install.sh -cat README.rst docs/screenshots.rst.distrib docs/documentation.rst.distrib > docs/index.rst +cat README.rst \ + docs/empty.rst.distrib \ + \ + docs/screenshots.rst.distrib \ + docs/empty.rst.distrib \ + \ + docs/documentation.rst.distrib \ + docs/empty.rst.distrib \ + \ + docs/submodules.rst.distrib \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/djangocms_integration/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/content/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/boolean/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/checkbox_select_multiple/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/date/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/date_drop_down/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/datetime/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/decimal/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/email/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/file/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/float/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/hidden/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/input/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/integer/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/ip_address/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/null_boolean/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/password/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/radio/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/range_select/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/regex/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/select/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/select_multiple/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/select_multiple_with_max/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/slider/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/slug/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/text/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/textarea/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/time/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_elements/fields/url/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_handlers/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_handlers/db_store/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_handlers/http_repost/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/drf_integration/form_handlers/mail/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/feincms_integration/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/apps/mezzanine_integration/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/content/content_image/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/content/content_image_url/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/content/content_text/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/content/content_video/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/boolean/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/checkbox_select_multiple/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/date/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/date_drop_down/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/datetime/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/decimal/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/email/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/file/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/float/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/hidden/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/input/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/integer/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/ip_address/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/null_boolean/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/password/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/radio/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/range_select/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/regex/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/select/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/select_model_object/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/select_mptt_model_object/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/select_multiple/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/select_multiple_model_objects/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/select_multiple_mptt_model_objects/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/select_multiple_with_max/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/slider/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/text/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/textarea/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/time/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/fields/url/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/security/captcha/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/security/honeypot/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_elements/test/dummy/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_handlers/db_store/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_handlers/http_repost/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_handlers/mail/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/plugins/form_importers/mailchimp_importer/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/themes/bootstrap3/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/themes/djangocms_admin_style_theme/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/themes/foundation5/README.rst \ + docs/empty.rst.distrib \ + \ + src/fobi/contrib/themes/simple/README.rst \ + docs/empty.rst.distrib \ + \ + > docs/index.rst cat QUICK_START.rst > docs/quickstart.rst +cat CHANGELOG.rst > docs/changelog.rst +cat LICENSES.rst > docs/licenses.rst sphinx-build -n -a -b html docs builddocs #sphinx-build -n -a -b pdf docs builddocs cd builddocs && zip -r ../builddocs.zip . -x ".*" && cd .. diff --git a/scripts/rebuild_docs.sh b/scripts/rebuild_docs.sh index 8c611b3c..29abaa69 100755 --- a/scripts/rebuild_docs.sh +++ b/scripts/rebuild_docs.sh @@ -1,5 +1,5 @@ -./scripts/uninstall.sh -./scripts/install.sh +#./scripts/uninstall.sh +#./scripts/install.sh rm docs/*.rst rm -rf builddocs/ sphinx-apidoc src/fobi --full -o docs -H 'django-fobi' -A 'Artur Barseghyan ' -V '0.1' -f -d 20 diff --git a/setup.py b/setup.py index 2526b6c2..c8ca498a 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys from distutils.version import LooseVersion from setuptools import setup, find_packages -version = '0.11.11' +version = '0.11.12' # *************************************************************************** # ************************** Python version ********************************* diff --git a/src/fobi/__init__.py b/src/fobi/__init__.py index 476ccc53..7f66a6be 100644 --- a/src/fobi/__init__.py +++ b/src/fobi/__init__.py @@ -1,6 +1,6 @@ __title__ = 'django-fobi' -__version__ = '0.11.11' -__build__ = 0x000086 +__version__ = '0.11.12' +__build__ = 0x000087 __author__ = 'Artur Barseghyan ' __copyright__ = '2014-2017 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' diff --git a/src/fobi/contrib/apps/drf_integration/TODOS.rst b/src/fobi/contrib/apps/drf_integration/TODOS.rst index 3a8b26e2..c5eea728 100644 --- a/src/fobi/contrib/apps/drf_integration/TODOS.rst +++ b/src/fobi/contrib/apps/drf_integration/TODOS.rst @@ -35,6 +35,11 @@ Must haves - Improve documentation. - Add more meta options for special fields, such as ``slider``. - Move DRF NoneField to the ``django-nonefield`` package (contrib). +- Add PhoneNumberField plugin. Most of the work on + (serializer) has already been done in the + `django-phonenumber-field + `_, so just make + use of it. Should haves ------------ diff --git a/src/fobi/contrib/apps/drf_integration/base.py b/src/fobi/contrib/apps/drf_integration/base.py index 7324fad8..52f074d2 100644 --- a/src/fobi/contrib/apps/drf_integration/base.py +++ b/src/fobi/contrib/apps/drf_integration/base.py @@ -36,7 +36,7 @@ LOGGER = logging.getLogger(__name__) class DRFIntegrationFormElementPluginProcessor( IntegrationFormElementPluginProcessor ): - """django-rest-framework field instance processor.""" + """Django REST framework field instance processor.""" def __init__(self, *args, **kwargs): super(DRFIntegrationFormElementPluginProcessor, self).__init__( @@ -45,6 +45,7 @@ class DRFIntegrationFormElementPluginProcessor( ) self.field_class = kwargs.get('field_class') self.field_kwargs = kwargs.get('field_kwargs', {}) + self.field_metadata = kwargs.get('field_metadata', {}) self.form_element_plugin = kwargs.get('form_element_plugin') self.data = self.form_element_plugin.data \ if self.form_element_plugin \ diff --git a/src/fobi/contrib/apps/drf_integration/dynamic.py b/src/fobi/contrib/apps/drf_integration/dynamic.py index 6b99bbed..63be0002 100644 --- a/src/fobi/contrib/apps/drf_integration/dynamic.py +++ b/src/fobi/contrib/apps/drf_integration/dynamic.py @@ -64,6 +64,7 @@ def get_declared_fields(form_entry, has_value=None): """Get declared fields.""" declared_fields = [] + declared_fields_metadata = [] if form_element_entries is None: form_element_entries = form_entry.formelemententry_set.all() @@ -88,17 +89,30 @@ def get_declared_fields(form_entry, ) for plugin_custom_field_instance \ in plugin_custom_field_instances: - # print(plugin_custom_field_instance.field_kwargs) - declared_fields.append( + + # The serializer field class + custom_field_class = plugin_custom_field_instance.field_class( + **plugin_custom_field_instance.field_kwargs + ) + + # Since serializer fields do not accept **kwargs, we need + # to assign `declared_fields_metadata` in the same way as we + # do with `declared_fields`. + declared_fields_metadata.append( ( plugin_custom_field_instance.data.name, - plugin_custom_field_instance.field_class( - **plugin_custom_field_instance.field_kwargs - ), + plugin_custom_field_instance.field_metadata ) ) - return OrderedDict(declared_fields) + declared_fields.append( + ( + plugin_custom_field_instance.data.name, + custom_field_class, + ) + ) + + return OrderedDict(declared_fields), OrderedDict(declared_fields_metadata) def assemble_serializer_class(form_entry, @@ -108,7 +122,8 @@ def assemble_serializer_class(form_entry, origin_return_func=None, form_element_entries=None, has_value=None, - declared_fields=None): + declared_fields=None, + declared_fields_metadata=None): """Assemble a serializer class by given entry. :param form_entry: @@ -164,7 +179,7 @@ def assemble_serializer_class(form_entry, # return DynamicSerializer if declared_fields is None: - declared_fields = get_declared_fields( + declared_fields, declared_fields_metadata = get_declared_fields( form_entry, origin=origin, origin_kwargs_update_func=origin_kwargs_update_func, @@ -199,9 +214,22 @@ def assemble_serializer_class(form_entry, return OrderedDict(fields) + @classmethod + def _get_declared_fields_metadata(cls, bases, attrs): + """Similar to _get_declared_fields, but for metadata.""" + fields = [ + (field_name, obj) for field_name, obj + in declared_fields_metadata.items() + if field_name not in attrs + ] + + return OrderedDict(fields) + def __new__(cls, name, bases, attrs): """Modified version of the original __new__.""" attrs['_declared_fields'] = cls._get_declared_fields(bases, attrs) + attrs['_declared_fields_metadata'] = \ + cls._get_declared_fields_metadata(bases, attrs) return super(SerializerMetaclass, cls).__new__(cls, name, bases, @@ -277,6 +305,19 @@ def assemble_serializer_class(form_entry, # serializer class. return copy.deepcopy(self._declared_fields) + def get_fields_metadata(self, field_name=None): + """ + Returns a dictionary of {field_name: field_instance}. + """ + # Every new serializer is created with a clone of the field + # instances. This allows users to dynamically modify the fields + # on a serializer instance without affecting every other + # serializer class. + fields_metadata = copy.deepcopy(self._declared_fields_metadata) + if field_name is not None: + return fields_metadata.get(field_name) + return fields_metadata + def get_validators(self): """ Returns a list of validator callables. diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/README.rst b/src/fobi/contrib/apps/drf_integration/form_elements/README.rst new file mode 100644 index 00000000..712a99fb --- /dev/null +++ b/src/fobi/contrib/apps/drf_integration/form_elements/README.rst @@ -0,0 +1,2 @@ +Form elements +------------- diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/README.rst b/src/fobi/contrib/apps/drf_integration/form_elements/content/README.rst new file mode 100644 index 00000000..6c9d1784 --- /dev/null +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/README.rst @@ -0,0 +1,3 @@ +Content form element +~~~~~~~~~~~~~~~~~~~~ +Presentational form elements for ``drf_integration``. diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/README.rst b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/README.rst index 5d497b47..c7cedd9c 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/README.rst +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/README.rst @@ -1,19 +1,19 @@ -fobi.contrib.apps.drf_integration.form_elements.fields.content_image -#################################################################### +fobi.contrib.apps.drf_integration.form_elements.content.content_image +##################################################################### A ``django-fobi`` ContentImage plugin for integration with ``Django REST framework``. Makes use of the ``fobi.contrib.apps.drf_integration.fields.ContentImage``. Installation ^^^^^^^^^^^^ -1. Add ``fobi.contrib.apps.drf_integration.form_elements.fields.content_image`` +1. Add ``fobi.contrib.apps.drf_integration.form_elements.content.content_image`` to the ``INSTALLED_APPS`` in your ``settings.py``. .. code-block:: python INSTALLED_APPS = ( # ... - 'fobi.contrib.apps.drf_integration.form_elements.fields.content_image', + 'fobi.contrib.apps.drf_integration.form_elements.content.content_image', # ... ) diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/base.py index 50e4c89d..0b7fce2e 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image/base.py @@ -41,6 +41,7 @@ class ContentImagePlugin(IntegrationFormElementPlugin, """Get form field instances.""" rendered_image = form_element_plugin.get_rendered_image() + raw_data = form_element_plugin.get_raw_data() field_kwargs = { 'initial': rendered_image, @@ -48,12 +49,19 @@ class ContentImagePlugin(IntegrationFormElementPlugin, 'required': False, 'label': '', 'read_only': True, - 'raw_data': form_element_plugin.get_raw_data(), + 'raw_data': raw_data, + } + field_metadata = { + 'type': 'content', + 'contenttype': 'image', + 'content': rendered_image, + 'raw_data': raw_data } return [ DRFIntegrationFormElementPluginProcessor( field_class=ContentImageField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/README.rst b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/README.rst index 6f0a5468..d9cbb5b2 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/README.rst +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/README.rst @@ -1,19 +1,19 @@ -fobi.contrib.apps.drf_integration.form_elements.fields.content_image_url -######################################################################## +fobi.contrib.apps.drf_integration.form_elements.content.content_image_url +######################################################################### A ``django-fobi`` ContentImageURL plugin for integration with ``Django REST framework``. Makes use of the ``fobi.contrib.apps.drf_integration.fields.ContentImage``. Installation ^^^^^^^^^^^^ -1. Add ``fobi.contrib.apps.drf_integration.form_elements.fields.content_image_url`` +1. Add ``fobi.contrib.apps.drf_integration.form_elements.content.content_image_url`` to the ``INSTALLED_APPS`` in your ``settings.py``. .. code-block:: python INSTALLED_APPS = ( # ... - 'fobi.contrib.apps.drf_integration.form_elements.fields.content_image_url', + 'fobi.contrib.apps.drf_integration.form_elements.content.content_image_url', # ... ) diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/base.py index 061205ec..f0a1f602 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_image_url/base.py @@ -41,6 +41,7 @@ class ContentImageURLPlugin(IntegrationFormElementPlugin, """Get form field instances.""" rendered_image = form_element_plugin.get_rendered_image() + raw_data = form_element_plugin.get_raw_data() field_kwargs = { 'initial': rendered_image, @@ -48,12 +49,19 @@ class ContentImageURLPlugin(IntegrationFormElementPlugin, 'required': False, 'label': '', 'read_only': True, - 'raw_data': form_element_plugin.get_raw_data(), + 'raw_data': raw_data, + } + field_metadata = { + 'type': 'content', + 'contenttype': 'image', + 'content': rendered_image, + 'raw_data': raw_data } return [ DRFIntegrationFormElementPluginProcessor( field_class=ContentImageField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/README.rst b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/README.rst index ca6a0394..a61f30e5 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/README.rst +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/README.rst @@ -1,19 +1,19 @@ -fobi.contrib.apps.drf_integration.form_elements.fields.content_text -################################################################### +fobi.contrib.apps.drf_integration.form_elements.content.content_text +#################################################################### A ``django-fobi`` ContentText plugin for integration with ``Django REST framework``. Makes use of the ``fobi.contrib.apps.drf_integration.fields.ContentText``. Installation ^^^^^^^^^^^^ -1. Add ``fobi.contrib.apps.drf_integration.form_elements.fields.content_text`` +1. Add ``fobi.contrib.apps.drf_integration.form_elements.content.content_text`` to the ``INSTALLED_APPS`` in your ``settings.py``. .. code-block:: python INSTALLED_APPS = ( # ... - 'fobi.contrib.apps.drf_integration.form_elements.fields.content_text', + 'fobi.contrib.apps.drf_integration.form_elements.content.content_text', # ... ) diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/base.py index a419dca3..b84389cc 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_text/base.py @@ -41,19 +41,26 @@ class ContentTextPlugin(IntegrationFormElementPlugin, """Get form field instances.""" rendered_text = form_element_plugin.get_rendered_text() - + raw_data = form_element_plugin.get_raw_data() field_kwargs = { 'initial': rendered_text, 'default': rendered_text, 'required': False, 'label': '', 'read_only': True, - 'raw_data': form_element_plugin.get_raw_data(), + 'raw_data': raw_data, + } + field_metadata = { + 'type': 'content', + 'contenttype': 'text', + 'content': rendered_text, + 'raw_data': raw_data } return [ DRFIntegrationFormElementPluginProcessor( field_class=ContentTextField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/README.rst b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/README.rst index 9a5bfc62..427705ce 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/README.rst +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/README.rst @@ -1,19 +1,19 @@ -fobi.contrib.apps.drf_integration.form_elements.fields.content_video -#################################################################### +fobi.contrib.apps.drf_integration.form_elements.content.content_video +##################################################################### A ``django-fobi`` ContentVideo plugin for integration with ``Django REST framework``. Makes use of the ``fobi.contrib.apps.drf_integration.fields.ContentVideo``. Installation ^^^^^^^^^^^^ -1. Add ``fobi.contrib.apps.drf_integration.form_elements.fields.content_video`` +1. Add ``fobi.contrib.apps.drf_integration.form_elements.content.content_video`` to the ``INSTALLED_APPS`` in your ``settings.py``. .. code-block:: python INSTALLED_APPS = ( # ... - 'fobi.contrib.apps.drf_integration.form_elements.fields.content_video', + 'fobi.contrib.apps.drf_integration.form_elements.content.content_video', # ... ) diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/base.py index 612cb124..22f2b673 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/content/content_video/base.py @@ -40,6 +40,7 @@ class ContentVideoPlugin(IntegrationFormElementPlugin, **kwargs): """Get form field instances.""" rendered_video = form_element_plugin.get_rendered_video() + raw_data = form_element_plugin.get_raw_data() field_kwargs = { 'initial': rendered_video, @@ -47,12 +48,19 @@ class ContentVideoPlugin(IntegrationFormElementPlugin, 'required': False, 'label': '', 'read_only': True, - 'raw_data': form_element_plugin.get_raw_data(), + 'raw_data': raw_data, + } + field_metadata = { + 'type': 'content', + 'contenttype': 'video', + 'content': rendered_video, + 'raw_data': raw_data } return [ DRFIntegrationFormElementPluginProcessor( field_class=ContentVideoField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/README.rst b/src/fobi/contrib/apps/drf_integration/form_elements/fields/README.rst new file mode 100644 index 00000000..1f6f76a4 --- /dev/null +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/README.rst @@ -0,0 +1,3 @@ +Fields +~~~~~~ +Form fields for ``drf_integration``. diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/decimal/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/decimal/base.py index 3d41e5c6..b92dfb26 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/decimal/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/decimal/base.py @@ -41,6 +41,9 @@ class DecimalInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } if form_element_plugin.data.initial: data_initial = decimal.Decimal( @@ -63,18 +66,23 @@ class DecimalInputPlugin(IntegrationFormFieldPlugin, if form_element_plugin.data.max_digits: data_max_digits = int(form_element_plugin.data.max_digits) field_kwargs.update({'max_digits': data_max_digits}) + field_metadata.update({'max_digits': data_max_digits}) else: field_kwargs.update({'max_digits': 10}) + field_metadata.update({'max_digits': 10}) if form_element_plugin.data.decimal_places: data_decimal_places = int(form_element_plugin.data.decimal_places) field_kwargs.update({'decimal_places': data_decimal_places}) + field_metadata.update({'decimal_places': data_decimal_places}) else: field_kwargs.update({'decimal_places': 5}) + field_metadata.update({'decimal_places': 5}) return [ DRFIntegrationFormElementPluginProcessor( field_class=DecimalField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/email/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/email/base.py index 4078ce08..1874cecf 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/email/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/email/base.py @@ -44,9 +44,15 @@ class EmailInputPlugin(IntegrationFormFieldPlugin, field_kwargs.update( {'max_length': int(form_element_plugin.data.max_length)} ) + + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } + return [ DRFIntegrationFormElementPluginProcessor( field_class=EmailField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/float/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/float/base.py index 57517b6d..1244f7d2 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/float/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/float/base.py @@ -39,6 +39,10 @@ class FloatInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } + if form_element_plugin.data.initial: field_kwargs['initial'] = float(form_element_plugin.data.initial) @@ -53,6 +57,7 @@ class FloatInputPlugin(IntegrationFormFieldPlugin, return [ DRFIntegrationFormElementPluginProcessor( field_class=FloatField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/input/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/input/base.py index 66aa3fa5..4259ce3c 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/input/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/input/base.py @@ -40,13 +40,59 @@ class InputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } + + if form_element_plugin.data.autocomplete_value: + field_metadata.update({'autocomplete': 'on'}) + + if form_element_plugin.data.autofocus_value: + field_metadata.update({'autofocus': 'autofocus'}) + + if form_element_plugin.data.disabled_value: + field_metadata.update({'disabled': 'disabled'}) + + if form_element_plugin.data.list_value: + field_metadata.update({'list': form_element_plugin.data.list_value}) + + if form_element_plugin.data.max_value: + field_metadata.update({'max': form_element_plugin.data.max_value}) + + if form_element_plugin.data.min_value: + field_metadata.update({'min': form_element_plugin.data.min_value}) + + if form_element_plugin.data.multiple_value: + field_metadata.update({'multiple': 'multiple'}) + + if form_element_plugin.data.pattern_value: + field_metadata.update( + {'pattern': form_element_plugin.data.pattern_value} + ) + + if form_element_plugin.data.readonly_value: + field_kwargs.update({'read_only': True}) + + if form_element_plugin.data.step_value: + field_metadata.update( + {'step': form_element_plugin.data.step_value} + ) + + if form_element_plugin.data.type_value \ + and form_element_plugin.data.type_value in ('submit', + 'button', + 'reset',): + field_metadata.update({'value': form_element_plugin.data.label}) + if form_element_plugin.data.max_length: field_kwargs.update( {'max_length': int(form_element_plugin.data.max_length)} ) + return [ DRFIntegrationFormElementPluginProcessor( field_class=CharField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/integer/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/integer/base.py index c1ace4e7..f38f89c1 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/integer/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/integer/base.py @@ -39,14 +39,26 @@ class IntegerInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } if form_element_plugin.data.initial: field_kwargs.update( {'initial': int(form_element_plugin.data.initial)} ) + if form_element_plugin.data.max_value: + data_max_value = int(form_element_plugin.data.max_value) + field_kwargs['max_value'] = data_max_value + + if form_element_plugin.data.min_value: + data_min_value = int(form_element_plugin.data.min_value) + field_kwargs['min_value'] = data_min_value return [ DRFIntegrationFormElementPluginProcessor( field_class=IntegerField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/ip_address/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/ip_address/base.py index 86a7c355..d01ccef9 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/ip_address/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/ip_address/base.py @@ -40,6 +40,9 @@ class IPAddressInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } if form_element_plugin.data.max_length: field_kwargs.update( {'max_length': int(form_element_plugin.data.max_length)} @@ -47,6 +50,7 @@ class IPAddressInputPlugin(IntegrationFormFieldPlugin, return [ DRFIntegrationFormElementPluginProcessor( field_class=IPAddressField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/password/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/password/base.py index 9e9c57dc..9e29d61e 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/password/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/password/base.py @@ -40,6 +40,9 @@ class PasswordInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } if form_element_plugin.data.max_length: field_kwargs.update( {'max_length': int(form_element_plugin.data.max_length)} @@ -48,6 +51,7 @@ class PasswordInputPlugin(IntegrationFormFieldPlugin, return [ DRFIntegrationFormElementPluginProcessor( field_class=CharField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/regex/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/regex/base.py index fd3adb13..0ba6cc8b 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/regex/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/regex/base.py @@ -41,12 +41,17 @@ class RegexInputPlugin(IntegrationFormFieldPlugin, 'help_text': form_element_plugin.data.help_text, 'regex': form_element_plugin.data.regex, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder, + 'regex': form_element_plugin.data.regex, + } if form_element_plugin.data.max_length: field_kwargs['max_length'] = form_element_plugin.data.max_length return [ DRFIntegrationFormElementPluginProcessor( field_class=RegexField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/slug/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/slug/base.py index 51ab2fe0..d6141c2c 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/slug/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/slug/base.py @@ -40,6 +40,9 @@ class SlugInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } if form_element_plugin.data.max_length: field_kwargs.update( {'max_length': int(form_element_plugin.data.max_length)} @@ -47,6 +50,7 @@ class SlugInputPlugin(IntegrationFormFieldPlugin, return [ DRFIntegrationFormElementPluginProcessor( field_class=SlugField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/text/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/text/base.py index 7141374e..20c1cd8a 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/text/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/text/base.py @@ -40,13 +40,18 @@ class TextInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } if form_element_plugin.data.max_length: field_kwargs.update({ 'max_length': int(form_element_plugin.data.max_length) }) + return [ DRFIntegrationFormElementPluginProcessor( field_class=CharField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/textarea/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/textarea/base.py index 6c2f8718..49959604 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/textarea/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/textarea/base.py @@ -40,9 +40,13 @@ class TextareaPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } return [ DRFIntegrationFormElementPluginProcessor( field_class=CharField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_elements/fields/url/base.py b/src/fobi/contrib/apps/drf_integration/form_elements/fields/url/base.py index cdb256e1..482de22e 100644 --- a/src/fobi/contrib/apps/drf_integration/form_elements/fields/url/base.py +++ b/src/fobi/contrib/apps/drf_integration/form_elements/fields/url/base.py @@ -40,6 +40,9 @@ class URLInputPlugin(IntegrationFormFieldPlugin, 'label': form_element_plugin.data.label, 'help_text': form_element_plugin.data.help_text, } + field_metadata = { + 'placeholder': form_element_plugin.data.placeholder + } if form_element_plugin.data.max_length: field_kwargs.update( {'max_length': int(form_element_plugin.data.max_length)} @@ -47,6 +50,7 @@ class URLInputPlugin(IntegrationFormFieldPlugin, return [ DRFIntegrationFormElementPluginProcessor( field_class=URLField, - field_kwargs=field_kwargs + field_kwargs=field_kwargs, + field_metadata=field_metadata ) ] diff --git a/src/fobi/contrib/apps/drf_integration/form_handlers/README.rst b/src/fobi/contrib/apps/drf_integration/form_handlers/README.rst new file mode 100644 index 00000000..1b540259 --- /dev/null +++ b/src/fobi/contrib/apps/drf_integration/form_handlers/README.rst @@ -0,0 +1,3 @@ +Form handlers +------------- +Form handlers for ``drf_integration``. diff --git a/src/fobi/contrib/apps/drf_integration/form_handlers/db_store/README.rst b/src/fobi/contrib/apps/drf_integration/form_handlers/db_store/README.rst index ed2f4e7d..4e9654a6 100644 --- a/src/fobi/contrib/apps/drf_integration/form_handlers/db_store/README.rst +++ b/src/fobi/contrib/apps/drf_integration/form_handlers/db_store/README.rst @@ -1,11 +1,11 @@ fobi.contrib.apps.drf_integration.form_handlers.db_store -######################################################## +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A ``django-fobi`` Mail form handler plugin for integration with ``Django REST framework``. Saves submitted form data into the ``SavedFormDataEntry`` model. Installation -^^^^^^^^^^^^ +############ 1. Add ``fobi.contrib.apps.drf_integration.form_handlers.db_store`` to the ``INSTALLED_APPS`` in your ``settings.py``. diff --git a/src/fobi/contrib/apps/drf_integration/form_handlers/http_repost/README.rst b/src/fobi/contrib/apps/drf_integration/form_handlers/http_repost/README.rst index 83fb1d27..f0417749 100644 --- a/src/fobi/contrib/apps/drf_integration/form_handlers/http_repost/README.rst +++ b/src/fobi/contrib/apps/drf_integration/form_handlers/http_repost/README.rst @@ -1,10 +1,10 @@ fobi.contrib.apps.drf_integration.form_handlers.http_repost -########################################################### +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A ``django-fobi`` HTTP repost form handler plugin for integration with ``Django REST framework``. Submits the form to another endpoint specified. Installation -^^^^^^^^^^^^ +############ 1. Add ``fobi.contrib.apps.drf_integration.form_handlers.http_respost`` to the ``INSTALLED_APPS`` in your ``settings.py``. diff --git a/src/fobi/contrib/apps/drf_integration/form_handlers/mail/README.rst b/src/fobi/contrib/apps/drf_integration/form_handlers/mail/README.rst index e9c27613..e5352b25 100644 --- a/src/fobi/contrib/apps/drf_integration/form_handlers/mail/README.rst +++ b/src/fobi/contrib/apps/drf_integration/form_handlers/mail/README.rst @@ -1,11 +1,11 @@ fobi.contrib.apps.drf_integration.form_handlers.mail -#################################################### +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A ``django-fobi`` Mail form handler plugin for integration with ``Django REST framework``. Submits the form data by email to the specified email address. Installation -^^^^^^^^^^^^ +############ 1. Add ``fobi.contrib.apps.drf_integration.form_handlers.mail`` to the ``INSTALLED_APPS`` in your ``settings.py``. diff --git a/src/fobi/contrib/apps/drf_integration/metadata.py b/src/fobi/contrib/apps/drf_integration/metadata.py index c1460b1e..ce9458d2 100644 --- a/src/fobi/contrib/apps/drf_integration/metadata.py +++ b/src/fobi/contrib/apps/drf_integration/metadata.py @@ -41,23 +41,18 @@ class FobiMetaData(SimpleMetadata): of metadata about it. """ field_info = super(FobiMetaData, self).get_field_info(field) - if isinstance( - field, - (ContentTextField, ContentImageField, ContentVideoField) - ): - field_info['type'] = 'content' - if isinstance(field, ContentTextField): - field_info['contenttype'] = 'text' - field_info['content'] = field.initial - field_info['raw'] = field.raw_data - elif isinstance(field, ContentImageField): - field_info['contenttype'] = 'image' - field_info['content'] = field.initial - field_info['raw'] = field.raw_data - else: - field_info['contenttype'] = 'video' - field_info['content'] = field.initial - field_info['raw'] = field.raw_data + for __key in ['initial', 'max_value', 'min_value']: + __val = getattr(field, __key, None) + if __val not in (None, ''): + field_info[__key] = __val + + field_metadata = field.root.get_fields_metadata().get( + field.field_name, {} + ) + if field_metadata: + for __k, __val in field_metadata.items(): + if __val not in (None, ''): + field_info[__k] = __val return field_info diff --git a/src/fobi/contrib/apps/drf_integration/serializers.py b/src/fobi/contrib/apps/drf_integration/serializers.py index 0eecbe54..6f0a7961 100644 --- a/src/fobi/contrib/apps/drf_integration/serializers.py +++ b/src/fobi/contrib/apps/drf_integration/serializers.py @@ -1,4 +1,6 @@ # from __future__ import unicode_literals +from collections import OrderedDict + from rest_framework import serializers from rest_framework.reverse import reverse @@ -42,3 +44,9 @@ class FormEntrySerializer(serializers.ModelSerializer): args=[obj.slug], request=self.context['request'] ) + + def get_fields_metadata(self, field_name=None): + """Just to make sure nothing breaks.""" + if field_name is not None: + return {} + return OrderedDict([]) diff --git a/src/fobi/contrib/apps/drf_integration/views.py b/src/fobi/contrib/apps/drf_integration/views.py index fb2335a1..51eb0eb5 100644 --- a/src/fobi/contrib/apps/drf_integration/views.py +++ b/src/fobi/contrib/apps/drf_integration/views.py @@ -76,7 +76,10 @@ class FobiFormEntryViewSet( # OK, calling this twice sucks, but fine for the time being. # In future we should try to get rid of additional queries # made double. - declared_fields = get_declared_fields(obj, has_value=self.has_value()) + declared_fields, declared_fields_metadata = get_declared_fields( + obj, + has_value=self.has_value() + ) # Setting all the fields, one by one like they were attributes of # the object (while they are obviously NOT). It's all done just to diff --git a/src/fobi/tests/data.py b/src/fobi/tests/data.py index e2160f69..646883d6 100644 --- a/src/fobi/tests/data.py +++ b/src/fobi/tests/data.py @@ -475,7 +475,8 @@ TEST_DYNAMIC_FORMS_DEFINITION_DATA = OrderedDict([ '"name": "username", ' '"required": true, ' '"max_length": 200, ' - '"label": "Username"' + '"label": "Username", ' + '"placeholder": "delusionalinsanity"' '}' ) ), @@ -597,7 +598,7 @@ FAKER = Faker() TEST_DYNAMIC_FORMS_PUT_DATA_ALL = { 'username': FAKER.user_name(), 'email': FAKER.email(), - 'age': FAKER.pyint(), + 'age': FAKER.random_int(min=0, max=200), 'drivers_license': FAKER.pybool(), 'special_fields': FAKER.pystr(), 'number_of_children': FAKER.pyint(), @@ -612,7 +613,8 @@ TEST_DYNAMIC_FORMS_OPTIONS_RESPONSE = OrderedDict([ (u'required', True), (u'read_only', False), (u'label', u'Username'), - (u'max_length', 200)])), + (u'max_length', 200), + (u'placeholder', 'delusionalinsanity')])), (u'email', OrderedDict([(u'type', u'email'), (u'required', True), (u'read_only', False), @@ -621,7 +623,8 @@ TEST_DYNAMIC_FORMS_OPTIONS_RESPONSE = OrderedDict([ (u'age', OrderedDict([(u'type', u'integer'), (u'required', True), (u'read_only', False), - (u'label', u'Age')])), + (u'label', u'Age'), + ('max_value', 200)])), (u'drivers_license', OrderedDict([(u'type', u'boolean'), (u'required', False), (u'read_only', False),