mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-24 20:23:44 +00:00
clean up
This commit is contained in:
parent
1817018812
commit
20d165e958
6 changed files with 0 additions and 130 deletions
|
|
@ -1,28 +0,0 @@
|
|||
===========================================================
|
||||
fobi.contrib.apps.drf_integration.form_elements.fields.text
|
||||
===========================================================
|
||||
A ``django-fobi`` CharField plugin for integration with
|
||||
``Django REST framework``. Makes use of the
|
||||
``rest_framework.fields.CharField``.
|
||||
|
||||
Installation
|
||||
============
|
||||
1. Add ``fobi.contrib.apps.drf_integration.form_elements.fields.text`` to
|
||||
the ``INSTALLED_APPS`` in your ``settings.py``.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
INSTALLED_APPS = (
|
||||
# ...
|
||||
'fobi.contrib.apps.drf_integration.form_elements.fields.text',
|
||||
# ...
|
||||
)
|
||||
|
||||
2. In the terminal type:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
./manage.py fobi_sync_plugins
|
||||
|
||||
3. Assign appropriate permissions to the target users/groups to be using
|
||||
the plugin if ``FOBI_RESTRICT_PLUGIN_ACCESS`` is set to True.
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
__title__ = 'fobi.contrib.apps.drf_integration.form_elements.content.' \
|
||||
'content_image'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
__all__ = ('default_app_config', 'UID',)
|
||||
|
||||
default_app_config = 'fobi.contrib.apps.drf_integration.form_elements.' \
|
||||
'content.content_image.apps.Config'
|
||||
|
||||
UID = 'content_image'
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
__title__ = 'fobi.contrib.apps.drf_integration.form_elements.content.' \
|
||||
'content_image.apps'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
|
||||
try:
|
||||
__all__ = ('Config',)
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
class Config(AppConfig):
|
||||
name = 'fobi.contrib.apps.drf_integration.form_elements.content.' \
|
||||
'content_image'
|
||||
label = 'fobi_contrib_apps_drf_integration_form_elements_content_' \
|
||||
'content_image'
|
||||
|
||||
except ImportError:
|
||||
pass
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
import logging
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .......base import IntegrationFormElementPlugin
|
||||
from .... import UID as INTEGRATE_WITH_UID
|
||||
from ....base import (
|
||||
DRFIntegrationFormElementPluginProcessor,
|
||||
DRFSubmitPluginFormDataMixin,
|
||||
)
|
||||
from ....fields import NoneField
|
||||
from . import UID
|
||||
|
||||
__title__ = 'fobi.contrib.apps.drf_integration.form_elements.content.' \
|
||||
'content_image.base'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
__all__ = ('ContentImagePlugin',)
|
||||
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ContentImagePlugin(IntegrationFormElementPlugin,
|
||||
DRFSubmitPluginFormDataMixin):
|
||||
"""CharField plugin."""
|
||||
|
||||
uid = UID
|
||||
integrate_with = INTEGRATE_WITH_UID
|
||||
name = _("Content image")
|
||||
group = _("Content")
|
||||
|
||||
def get_custom_field_instances(self,
|
||||
form_element_plugin,
|
||||
request=None,
|
||||
form_entry=None,
|
||||
form_element_entries=None,
|
||||
has_value=None,
|
||||
**kwargs):
|
||||
"""Get form field instances."""
|
||||
|
||||
rendered_image = form_element_plugin.get_rendered_image()
|
||||
|
||||
LOGGER.debug(rendered_image)
|
||||
|
||||
field_kwargs = {
|
||||
'initial': rendered_image,
|
||||
'default': rendered_image,
|
||||
'required': False,
|
||||
'label': '',
|
||||
'read_only': True,
|
||||
}
|
||||
|
||||
return [
|
||||
DRFIntegrationFormElementPluginProcessor(
|
||||
field_class=NoneField,
|
||||
field_kwargs=field_kwargs
|
||||
)
|
||||
]
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
from .......base import integration_form_element_plugin_registry
|
||||
from .base import ContentImagePlugin
|
||||
|
||||
__title__ = 'fobi.contrib.apps.drf_integration.form_elements.content.' \
|
||||
'content_image.fobi_integration_form_elements'
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2017 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
__all__ = ('ContentImagePlugin',)
|
||||
|
||||
|
||||
integration_form_element_plugin_registry.register(ContentImagePlugin)
|
||||
Loading…
Reference in a new issue