Package: django-popupcrud
A CRUD framework leveraging Django’s generic views that implements CRUD
operations through HTML popups.RequirementsPython >= 3.4Django >= 2.2.8django-bootstrap3django-pure-paginationDocumentationAvailable atdjango-popupcrud.readthedocs.io.QuickstartInstalldjango-popupcrudusing pip:pip installdjango-popucrudOr install it directly from the source repository:pip installgit+https://github.com/harikvpy/django-popupcrud.gitYet another way would be to clone this repository and install from the cloned
root folder viapip install-e..Install the dependencies -django-bootstrap3anddjango-pure-pagination.  Add the dependencies andpopupcrudtoINSTALLED_APPSin your project’ssettings.py:INSTALLED_APPS = [
    ...
    'bootstrap3',
    'pure_pagination',
    'popupcrud',
    ...
]LetPopupCrudViewSetknow of your base template file name. This defaults
tobase.html, but if your project uses a different base template
filename, informPopupCrudViewSetabout it insettings.py:POPUPCRUD = {
    'base_template': 'mybase.html',
}Include Bootstrap CSS & JS resources in this base template.
If you were to usedjango-bootstrap3tags 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 namedextraheadwithin the<head>element.PopupCrudViewSetviews use a few custom CSS styles to show column
sorting options and sort priority. These styles are defined instatic/popupcrud/css/popupcrud.csswhich is inserted into
theextraheadblock. If you don’t declare this block,
you will have to explicitly load the stylesheet into your base template.In your app’sviews.py, create aViewSetfor 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.nameViews.py:from django.core.urlresolvers import reverse_lazy, reverse
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("library:authors:update", kwargs={'pk': obj.pk})

    def get_delete_url(self, obj):
        return reverse("library:authors:delete", kwargs={'pk': obj.pk})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 viewauthors/create/- create viewauthors/<pk>/- detail viewauthors/<pk>/update/- update viewauthors/<pk>/delete/- delete viewThe urls are registered under its own namespace, which defaults to the
model’sverbose_name_pluralmeta value.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.LicenseDistributed under BSD 3-Clause License. SeeLICENSEfile for details.History0.1.0 (2017-09-25)Initial release0.1.2 (2017-09-26)Merge Quickstart section into README0.1.3 (2017-09-26)Add missing HISTORY.rst to manifst0.1.4 (2017-09-26)Support fororder_fieldattribute forlist_displaymethod fields.
This works similar toModelAdminmethod fields’admin_order_fieldproperty.0.1.5 (2017-09-26)Better unicode support0.1.6 (2017-09-27)Better access control support through ‘login_url’ & ‘raise_exception’
PopupCrudViewSet properties0.1.7 (2017-10-13)Object detail view support0.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 #10.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 releaseAdded ‘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.0.3.0 (2017-10-26)List view content is rendered in its own block, popupcrud_list, in the
template file. This allows the list content to be relocated to different
parts of the base template.Add ViewSet.empty_list_icon and ViewSet.empty_list_message properties. These
properties provide for prettier rendering of empty table states.0.3.1 (2017-10-26)Use custom style for empty-list-state icon sizing. Earlier code was using font
awesome style.0.4.0 (2017-11-2)Breadcrumbs supportListView queryset custom filtering throughPopupCrudViewSet.get_queryset()Support custom form init args throughPopupCrudViewSet.get_form_kwargs()PopupCrudViewSet.new_urlandPopupCrudViewSet.list_urlare determined
throughPopupCrudViewSet.get_new_url()andPopupCrudViewSet.get_list_url()throughout the code.0.4.1 (2017-11-6)Fix an issue where when form with errors is rendered select2 and add-related
widgets are not bound correctly0.5.0 (2017-11-10)Add custom item action supportClean up JavaScript by encapsulating all methods in its own namespace &
reducing code duplicationAdd missing CSS styles to popupcrud.cssEmpty_list_message class variable now allows embedded html tags (value is
wrapped in mark_safe() before placing in template context)0.6.0 (2018-03-15)Add formset support in CRUD create/update viewsAdd size option to bsmodal template tagsFixes to some minor bugs0.6.1 (2018-03-16)Make formset alignment consistent with bootstrap3 settings
horizontal_label_class & horizontal_field_class.0.6.2 (2018-03-17)Fix bug where forms with m2m fields were not savedReflect formset form field ‘required’ status in field column headerMake formsets work in legacy crud modedjango-select2 support in formset formsMinor formset layout formatting improvements0.6.3 (2018-03-18)Fix incorrect formset detection logic0.6.4 (2018-03-26)Optimize listview media when create & edit are set to legacyBreadcrumbs obeys custom page titleFix bug in ListView.media optimizationIntroduce permissions_required attributePopupCrudViewSet.get_page_title now used in for all CRUD(legacy) views0.7.0 (2018-06-20)Add support forpk_url_kwarg,slug_field,slug_url_kwarg&context_object_nameViewSet attributes.Improve documentation0.7.1 (2018-06-20)Update release history0.8.0 (2018-10-31)Allow html tags in custom column headers; hide Action column if there’re
no item actionsSupport view template context data in ViewSet0.9.0 (2019-12-25)Django 3.0 support0.10.0 (2019-12-26)Fix rendering bugs owing to changes in Django 3.00.11.0 (2019-12-26)Bump min Django ver to 2.2.80.12.0 (2019-12-26)Fix README formatting errors