mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-10 22:03:09 +00:00
Merge branch 'master' into wagtail/integration
This commit is contained in:
commit
abb7ff027e
62 changed files with 2487 additions and 99 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -11,6 +11,7 @@ ghostdriver.log
|
|||
/dev.db
|
||||
/.cache/
|
||||
/htmlcov/
|
||||
/third_party/
|
||||
*.py,cover
|
||||
/.idea/
|
||||
codebin.py
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
32
README.rst
32
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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
1367
docs/changelog.rst
Normal file
1367
docs/changelog.rst
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -8,6 +8,8 @@ Contents:
|
|||
|
||||
fobi
|
||||
quickstart
|
||||
changelog
|
||||
licenses
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
|
|
|||
2
docs/empty.rst.distrib
Normal file
2
docs/empty.rst.distrib
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
|
||||
|
|
@ -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
|
||||
---------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
---------------
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
----------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
---------------
|
||||
|
|
|
|||
|
|
@ -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
|
||||
==================
|
||||
|
|
|
|||
182
docs/licenses.rst
Normal file
182
docs/licenses.rst
Normal file
|
|
@ -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)
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
4
docs/submodules.rst.distrib
Normal file
4
docs/submodules.rst.distrib
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(Sub)modules
|
||||
============
|
||||
Some additional documentation on ``django-fobi`` sub-modules are listed
|
||||
below.
|
||||
1
examples/saved_forms_in_json_format/test-drf-form.json
Normal file
1
examples/saved_forms_in_json_format/test-drf-form.json
Normal file
|
|
@ -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"}
|
||||
|
|
@ -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 ..
|
||||
|
|
|
|||
|
|
@ -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 <artur.barseghyan@gmail.com>' -V '0.1' -f -d 20
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -4,7 +4,7 @@ import sys
|
|||
from distutils.version import LooseVersion
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
version = '0.11.11'
|
||||
version = '0.11.12'
|
||||
|
||||
# ***************************************************************************
|
||||
# ************************** Python version *********************************
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
__title__ = 'django-fobi'
|
||||
__version__ = '0.11.11'
|
||||
__build__ = 0x000086
|
||||
__version__ = '0.11.12'
|
||||
__build__ = 0x000087
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
<https://github.com/stefanfoulis/django-phonenumber-field>`_, so just make
|
||||
use of it.
|
||||
|
||||
Should haves
|
||||
------------
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Form elements
|
||||
-------------
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
Content form element
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
Presentational form elements for ``drf_integration``.
|
||||
|
|
@ -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',
|
||||
# ...
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
# ...
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
# ...
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
# ...
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
Fields
|
||||
~~~~~~
|
||||
Form fields for ``drf_integration``.
|
||||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
Form handlers
|
||||
-------------
|
||||
Form handlers for ``drf_integration``.
|
||||
|
|
@ -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``.
|
||||
|
||||
|
|
|
|||
|
|
@ -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``.
|
||||
|
||||
|
|
|
|||
|
|
@ -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``.
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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([])
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue