Django AJAX ModelForms. Read-only display ModelForms. Django AJAX grids with CRUD and custom actions. Supports DTL.
Project description
Screenshot of sample application:
More screenshots with description are available at: https://github.com/Dmitri-Sintsov/djk-sample/wiki
Sample application: https://github.com/Dmitri-Sintsov/djk-sample
Documentation (in development): https://django-jinja-knockout.readthedocs.org/
Key features
Django 1.8, 1.9. 1.10 support. Python 3.4 / 3.5 support.
Bootstrap 3 / Jinja2 / Knockout.js integration into Django projects.
No deep knowledge of Knockout.js is required: it has ready working components.
Dynamic adding / removing of inline formsets with Knockout.js, protected from XSS.
Django raw queries with filter() / exclude() / order() / values() / values_list() and SQL slicing support via FilteredRawQuerySet, suitable for ListView / ListSortingView / KoGridView.
Knockout.js powered AJAX django.admin-like grids (paginated tables) with sorting / filters and custom actions.
ForeignKeyGridWidget provides ForeignKeyRawIdWidget-like functionality to select ModelForm foreign key field value via AJAX query / response.
Supports existing Django templates (DTL). Jinja2 templates can be integrated into existing Django templates via custom template library tag:
{% extends 'base_min.html' %} {% load jinja %} {% load staticfiles %} {% block main %} {% jinja 'bs_list.htm' with _render_=1 view=view object_list=object_list is_paginated=is_paginated page_obj=page_obj %} {% endblock main %}
Major changes (version 0.2.0)
$.inherit() Javascript prototype inheritance function now supports multi-level inheritance with nested .super calls without having to specify parent class prototype property implicitely in descendant class instances, with newly introduced $.SuperChain class.
“django.admin-like” AJAX functionality was implemented via KoGridView class-based view (CBV) at server-side with corresponding Knockout.js templates and Javascript classes at client-side. Besides providing standard CRUD actions and filters, it allows to implement arbitrary actions in descendant classes and quickly design django.admin-like user interfaces in non-admin views. AJAX calls also minimize server HTTP traffic, reducing network bandwitch and making the UI more responsive.
New ForeignKeyGridWidget was developed which provides ForeignKeyRawIdWidget-like functionality in non-admin ModelForm classes to select foreign key fields value via AJAX query / response.
Support of auto-instantiating Javascript classes with binding these to selected DOM nodes with ‘component’ css class via App.Components class.
Support of auto-compiling / auto-loading client-side underscore.js templates via App.compileTemplate / App.domTemplate / App.loadTemplates. One of usage examples is the possibility of loading modal body from underscore.js template in App.Dialog.
Support of client-side generation of view urls with kwargs for client-side url names via updated context_processors.py and client-side App.routeUrl() Javascript function.
tpl.resolve_cbv() allows to resolve view class via url name and it’s kwargs.
Django templates (DTL) and Jinja2 templates now can be mixed using shared Jinja2 template code via {% load jinja %} template library jinja template tags, which performs include for Jinja2 template with current context:
{% extends 'base_min.html' %} {% load jinja %} {% load staticfiles %} {% block main %} {% jinja 'bs_list.htm' with _render_=1 view=view object_list=object_list is_paginated=is_paginated page_obj=page_obj %} {% endblock main %}
Numerous bug fixes.
Documentation
The full documentation is at https://django-jinja-knockout.readthedocs.org.
History
0.1.0
To be released on PyPI.
0.2.0
Django 1.8 / 1.9 / 1.10, Python 3.4 / 3.5 support.
djk-sample demo / automated testing project.
“django.admin-like” AJAX functionality implemented via KoGridView class-based view.
$.inherit() Javascript prototype inheritance function now supports multi-level inheritance with nested ._super._call().
FilteredRawQuerySet supports Django raw querysets with .filter() / .exclude() / .order_by() / .values() / .values_list() and SQL level slicing.
ForeignKeyGridWidget provides ForeignKeyRawIdWidget -like functionality via AJAX query / response in non-admin forms to select ModelForm foreign key values.
Client-side generation of view urls with kwargs in Javascript client-side routes via App.routeUrl().
Nested autocompiled underscore.js client-side templates for Javascript components, primarily used with Knockout.js, but is not limited to.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-jinja-knockout-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98323f9faea3da94ee9075f9bbc4f4760cd57bcc6b069a5cf8c1218f5cc9ac93 |
|
MD5 | b21ffae95d97f8ad606e17db204e1037 |
|
BLAKE2b-256 | f0e5efdc5d5b1b3d090c66d2cdad75f57a0ef1e37196e2ece135e57cfa0300d0 |