From 9b088f32f255ea853f8fcff47c3e7d122a60b935 Mon Sep 17 00:00:00 2001 From: Asif Date: Mon, 11 Apr 2016 08:19:19 +0300 Subject: [PATCH] bump version, breadcrumbs --- README.rst | 38 ++-------------------- crudbuilder/__init__.py | 2 +- crudbuilder/templates/inline/create.html | 7 ++++ crudbuilder/templates/inline/detail.html | 25 +++++++++++--- crudbuilder/templates/instance/create.html | 8 +++++ crudbuilder/templates/instance/delete.html | 9 +++++ crudbuilder/templates/instance/detail.html | 21 ++++++++++-- crudbuilder/templates/instance/list.html | 9 +++-- crudbuilder/templates/instance/update.html | 9 +++++ docs/source/overview.rst | 2 ++ 10 files changed, 84 insertions(+), 46 deletions(-) diff --git a/README.rst b/README.rst index f3cefee..157dda1 100644 --- a/README.rst +++ b/README.rst @@ -41,6 +41,7 @@ Features: - Separate CREATE and UPDATE forms - Define your own custom queryset for list view - Inline Formset support for parent child models +- Default Bootstrap3 CSS Prerequisites ------------- @@ -70,6 +71,7 @@ Usage LOGIN_REQUIRED_FOR_CRUD = True/False PERMISSION_REQUIRED_FOR_CRUD = True/False + PROJECT_NAME = 'YOUR PROJECT NAME' **Create models in yourapp/models.py** @@ -194,41 +196,5 @@ Added mixin which allows access to additional template variables like app lable PLURIZED MODEL : {{pluralized_model_name}} -EXTENDABLE ----------- -All the generated views/tables/forms/url are extendable. - -.. code-block:: python - - # GENERATE CRUD CLASSES - from crudbuilder.views import ViewBuilder - builder = ViewBuilder('example', 'person', crudclass) - builder.generate_crud() - builder.classes - - {'PersonCreateView': , - 'PersonDeleteView': , - 'PersonListView': , - 'PersonUpdateView': , - 'PersonDetailView': - } - - # OVERRIDE AUTO GENERATED VIEWS - from crudbuilder.views import ViewBuilder - builder = ViewBuilder('example', 'person') - builder.generate_crud() - PersonListView = builder.classes['PersonListView'] - class CustomPersonListView(PersonListView): - def get_context_data(self, **kwargs): - context = super(CustomPersonListView, self).get_context_data(**kwargs) - context['your_template_variable'] = 'Your new template variable' - return context - - # OVERRIDE AUTO GENERATED TABLE (from django_tables2) - from crudbuilder.tables import TableBuilder - builder = TableBuilder('example', 'person') - PersonTable = builder.generate_table() - class CustomPersonTable(PersonTable): - # add your custom implementation here diff --git a/crudbuilder/__init__.py b/crudbuilder/__init__.py index 55cc243..4c2237d 100644 --- a/crudbuilder/__init__.py +++ b/crudbuilder/__init__.py @@ -5,4 +5,4 @@ registry ) -VERSION = '0.1.9' \ No newline at end of file +VERSION = '0.1.10' \ No newline at end of file diff --git a/crudbuilder/templates/inline/create.html b/crudbuilder/templates/inline/create.html index 1cbacda..d121ba7 100644 --- a/crudbuilder/templates/inline/create.html +++ b/crudbuilder/templates/inline/create.html @@ -2,6 +2,13 @@ {% load tags %} {% load staticfiles %} +{% block breadcrumb %} + +{% endblock %} + {% block js %} diff --git a/crudbuilder/templates/inline/detail.html b/crudbuilder/templates/inline/detail.html index 03da12f..243ed0e 100644 --- a/crudbuilder/templates/inline/detail.html +++ b/crudbuilder/templates/inline/detail.html @@ -2,12 +2,27 @@ {% load tags %} +{% block css %} + +{% endblock %} + + +{% block breadcrumb %} + +{% endblock %} + {% block main_content %} - {% block actions %} - Update - Delete - {% endblock %} -
+ {% block actions %} + Update + Delete + {% endblock %}

{{object}}

diff --git a/crudbuilder/templates/instance/create.html b/crudbuilder/templates/instance/create.html index ff29aa2..61b56d6 100644 --- a/crudbuilder/templates/instance/create.html +++ b/crudbuilder/templates/instance/create.html @@ -1,6 +1,14 @@ {% extends "base.html" %} {% load tags %} +{% block breadcrumb %} + +{% endblock %} + + {% block main_content %}
diff --git a/crudbuilder/templates/instance/delete.html b/crudbuilder/templates/instance/delete.html index a8ce01e..c5c542e 100644 --- a/crudbuilder/templates/instance/delete.html +++ b/crudbuilder/templates/instance/delete.html @@ -1,6 +1,15 @@ {% extends "base.html" %} {% load tags %} +{% block breadcrumb %} + +{% endblock %} + + {% block main_content %}

Delete {{actual_model_name}}

diff --git a/crudbuilder/templates/instance/detail.html b/crudbuilder/templates/instance/detail.html index a92ebd2..3a31591 100644 --- a/crudbuilder/templates/instance/detail.html +++ b/crudbuilder/templates/instance/detail.html @@ -2,10 +2,27 @@ {% load tags %} +{% block css %} + +{% endblock %} + + +{% block breadcrumb %} + +{% endblock %} + + {% block main_content %} {% block actions %} - Update - Delete + Update + Delete {% endblock %}
diff --git a/crudbuilder/templates/instance/list.html b/crudbuilder/templates/instance/list.html index 6265700..514b792 100644 --- a/crudbuilder/templates/instance/list.html +++ b/crudbuilder/templates/instance/list.html @@ -2,12 +2,17 @@ {% load tags %} {% load render_table from django_tables2 %} +{% block breadcrumb %} + +{% endblock %} + {% block main_content %} {% block actions %} - Add {{actual_model_name|title}} + Add {{actual_model_name|title}} {% endblock %} -
diff --git a/crudbuilder/templates/instance/update.html b/crudbuilder/templates/instance/update.html index ba504f2..d64ed45 100644 --- a/crudbuilder/templates/instance/update.html +++ b/crudbuilder/templates/instance/update.html @@ -1,6 +1,15 @@ {% extends "base.html" %} {% load tags %} +{% block breadcrumb %} + +{% endblock %} + + {% block main_content %}
diff --git a/docs/source/overview.rst b/docs/source/overview.rst index e4c8987..0b7a881 100644 --- a/docs/source/overview.rst +++ b/docs/source/overview.rst @@ -16,6 +16,8 @@ Features - Add your own templates for List/Create/Detail/Update/Delete views - Separate CREATE and UPDATE forms - Define your own custom queryset for list view +- Inline Formset support for parent child models +- Default Bootstrap3 CSS Requirements and Compatibility