Metadata-Version: 1.1
Name: django-popupcrud
Version: 0.2.1
Summary: A CRUD framework that uses HTML popups for CRUD operations.
Home-page: https://github.com/harikvpy/django-popupcrud
Author: Hari Mahadevan
Author-email: hari@smallpearl.com
License: BSD 3-Clause License
Description-Content-Type: UNKNOWN
Description: ================
        django-popupcrud
        ================
        
        A CRUD framework leveraging Django's generic views that implements CRUD 
        operations through HTML popups.
        
        .. image:: https://img.shields.io/pypi/v/django-popupcrud.svg
            :target: https://pypi.python.org/pypi/django-popupcrud
            :alt: Latest PyPI version
        
        .. image:: https://img.shields.io/pypi/dm/django-popupcrud.svg
            :target: https://pypi.python.org/pypi/django-popupcrud
            :alt: Number of PyPI downloads per month
        
        Requirements
        ------------
        
        - Python 2.7, 3.4
        - Django >= 1.9
        - `django-bootstrap3 <https://github.com/dyve/django-bootstrap3.git>`_
        - `django-pure-pagination <https://github.com/jamespacileo/django-pure-pagination.git>`_
        
        Documentation
        -------------
        
        Available at `django-popupcrud.readthedocs.io 
        <http://django-popupcrud.readthedocs.io/en/latest/index.html>`_.
        
        Quickstart
        ----------
        
        1. Install ``django-popupcrud`` using pip: 
        
           ``pip install django-popucrud``
           
           Or install it directly from the source repository:
           
           ``pip intall git+https://github.com/harikvpy/django-popupcrud.git``
        
           Yet another way would be to clone this repository and install from the cloned 
           root folder via ``pip install -e .``.
        
        2. Install the dependencies - ``django-bootstrap3`` and 
           ``django-pure-pagination``.  Add the dependencies and ``popupcrud`` to 
           ``INSTALLED_APPS`` in your project's ``settings.py``::
        
               INSTALLED_APPS = [
                   ...
                   'bootstrap3',
                   'pure_pagination',
                   'popupcrud',
                   ...
               ]
        
        3. Let ``PopupCrudViewSet`` know of your base template file name. This defaults 
           to ``base.html``, but if your project uses a different base template 
           filename, inform ``PopupCrudViewSet`` about it in ``settings.py``::
        
                POPUPCRUD = {
                    'base_template': 'mybase.html',
                }
        
           Include Bootstrap CSS & JS resources in this base template.
           If you were to use ``django-bootstrap3`` tags for these, your base 
           template should look something like this::
        
            <head>
                {% bootstrap_css %}
                <script src="{% bootstrap_jquery_url %}" type="text/javascript" charset="utf-8"></script>
                {% bootstrap_javascript %}
                {% block extrahead %}{% endblock extrahead %}
            </head>
        
           Also, define a block named ``extrahead`` within the ``<head>`` element.
           ``PopupCrudViewSet`` views use a few custom CSS styles to show column 
           sorting options and sort priority. These styles are defined in 
           ``static/popupcrud/css/popupcrud.css`` which is inserted into 
           the ``extrahead`` block. If you don't declare this block,
           you will have to explicitly load the stylesheet into your base template.
        
        4. In your app's ``views.py``, create a ``ViewSet`` for each model for which you
           want to support CRUD operations.
        
           Models.py::
        
            from django.db import models
        
            class Author(models.Model):
                name = models.CharField("Name", max_length=128)
                penname = models.CharField("Pen Name", max_length=128)
                age = models.SmallIntegerField("Age", null=True, blank=True)
        
                class Meta:
                    ordering = ('name',)
                    verbose_name = "Author"
                    verbose_name_plural = "Authors"
        
                def __str__(self):
                    return self.name
        
           Views.py::
        
            from popupcrud.views import PopupCrudViewSet
        
            class AuthorViewSet(PopupCrudViewSet):
                model = Author
                fields = ('name', 'penname', 'age')
                list_display = ('name', 'penname', 'age')
                list_url = reverse_lazy("library:authors:list")
                new_url = reverse_lazy("library:authors:create")
        
                def get_edit_url(self, obj):
                    return reverse_lazy("library:authors:update", kwargs={'pk': obj.pk})
        
                def get_delete_url(self, obj):
                    return reverse_lazy("library:authors:delete", kwargs={'pk': obj.pk})
        
        5. Wire up the CRUD views generated by the viewset to the URLconf::
        
                urlpatterns= [
                    url(r'^authors/', views.AuthorCrudViewset.urls()),
                ]
        
           This will register the following urls:
        
            * ``authors/`` - list view
            * ``authors/create/`` - create view
            * ``authors/<pk>/`` - detail view
            * ``authors/<pk>/update/`` - update view
            * ``authors/<pk>/delete/`` - delete view
        
           The urls are registered under its own namespace, which defaults to the 
           model's ``verbose_name_plural`` meta value.
        
        6. Thats it! Your modern HTML popup based CRUD for your table is up and running.
        
           PopupCrudViewSet has many options to customize the fields displayed in list
           view, form used for create/update operations, permission control and more.
           Refer to the Reference and How-to sections of the documentation for more
           details.
        
        License
        -------
        Distributed under BSD 3-Clause License. See `LICENSE 
        <LICENSE>`_ file for details.
        
        
        History
        -------
        
        0.1.0 (2017-09-25)
        ++++++++++++++++++
        
        * Initial release
        
        0.1.2 (2017-09-26)
        ++++++++++++++++++
        
        * Merge Quickstart section into README
        
        0.1.3 (2017-09-26)
        ++++++++++++++++++
        
        * Add missing HISTORY.rst to manifst
        
        0.1.4 (2017-09-26)
        ++++++++++++++++++
        
        * Support for ``order_field`` attribute for ``list_display`` method fields.
          This works similar to ``ModelAdmin`` method fields' ``admin_order_field``
          property.
        
        0.1.5 (2017-09-26)
        ++++++++++++++++++
        
        * Better unicode support
        
        0.1.6 (2017-09-27)
        ++++++++++++++++++
        
        * Better access control support through 'login_url' & 'raise_exception'
          PopupCrudViewSet properties
        
        0.1.7 (2017-10-13)
        ++++++++++++++++++
        
        * Object detail view support 
        
        0.1.8 (2017-10-16)
        ++++++++++++++++++
        
        * Add PopupCrudViewSet.urls() -- a single method to return all the CRUD urls 
          that can be added to urlpatterns[].
        * When related object popup is activated on a multiselect select and it adds a 
          new object, the object is added to the existing list of selections. (old code
          used to replace all the current selections with the newly added item)
        * Insert all form media into ListView through ListView.media property. 
        * Fix broken support for django-select2 in modals by setting control's 
          dropdownParent to the modal (rather than parent window)
        * Use the 'create-edit-modal' modal as the template for secondary modals
          activated through related-model modal popups. This ensures consistent modal 
          look and feel if the user customized the modal template by overriding 
          popupcrud/modal.html template.
        * Fix ALLOWED_HOSTS in settings - issue #1
        
        0.2.0 (2017-10-18)
        ++++++++++++++++++
        * Bumping minor version as reflection of new features legacy_crud dict, media 
          & out-of-the-box django_select2 support in previous release
        * Added 'crudform.ready' JavaScript event, which is triggered when 
          create/update form is activated. This event provides clients an uniform way to 
          apply their own optional initialization code to the CRUD forms.
        * Added 6 more tests to cover new legacy_crud dict value support & form media
          injection.
        
Keywords: django-popupcrud
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Software Development :: Libraries
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
