generated from djangoaddicts/django_package_template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding list view with pygwalker link * cleaning up list view and generic view * adding unittests; code quality updates * updating documentation * update version history
- Loading branch information
1 parent
0193197
commit a9c0dfe
Showing
14 changed files
with
295 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/djangoaddicts/pygwalker/templates/pygwalker/bs5/list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends base_template|default:"handyhelpers/handyhelpers_base.htm" %} | ||
{% load static %} | ||
{% load handyhelper_tags %} | ||
|
||
{% block local_head %} | ||
{% include "handyhelpers/component/bs5/table_components.htm" %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% include "pygwalker/bs5/partials/list_content.htm" %} | ||
{% endblock content %} |
7 changes: 7 additions & 0 deletions
7
src/djangoaddicts/pygwalker/templates/pygwalker/bs5/list_no_component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends base_template|default:"handyhelpers/handyhelpers_base.htm" %} | ||
{% load static %} | ||
{% load handyhelper_tags %} | ||
|
||
{% block content %} | ||
{% include "pygwalker/bs5/partials/list_content.htm" %} | ||
{% endblock content %} |
67 changes: 67 additions & 0 deletions
67
src/djangoaddicts/pygwalker/templates/pygwalker/bs5/partials/list_content.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{% load handyhelper_tags %} | ||
<div class="container-fluid animated fadeIn my-5"> | ||
<h1><span class="text-primary"><b>{{ title }}:</b></span> {% if subtitle %}<span class="text-secondary"><small><small>{{ subtitle }}</small></small></span>{% endif %}</h1> | ||
|
||
<div class="text-end"> | ||
{# To include a pygwalker link, include the pygwalker_url in the context of your view #} | ||
{% if pygwalker_url %} | ||
<a href="{{ pygwalker_url|safe }}" class="mx-2"><i class="fa-solid fa-magnifying-glass-chart" title="PyGWalker view"></i></a> | ||
{% endif %} | ||
|
||
{# To include a create form, exposed via modal, include create_form (dict) in the context of your view. The create_from must include modal_name and link_title fields #} | ||
{% if create_form %} | ||
{% if allow_create_groups and request.user|in_any_group:allow_create_groups %} | ||
<a href="#" data-bs-toggle="modal" data-bs-target="#modal_{{ create_form.modal_name }}" title="{{ create_form.tool_tip|default_if_none:'create' }}"> | ||
<i class="fas fa-plus-circle"></i> | ||
{% if create_form.link_title %} {{ create_form.link_title }} {% endif %} | ||
</a> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{# To include a filter form, exposed via modal, include filter_form (dict) in the context of your view. The filter_from must include modal_name and link_title fields #} | ||
{% if filter_form %} | ||
<a href="#" data-bs-toggle="modal" data-bs-target="#modal_{{ filter_form.modal_name }}" title="{{ filter_form.tool_tip|default_if_none:'filter' }}" class="ms-2"> | ||
<i class="fas fa-filter"></i> | ||
{% if filter_form.link_title %} {{ filter_form.link_title }} {% endif %} | ||
</a> | ||
{% if filter_form.undo and request.META.QUERY_STRING %} | ||
<a href="{% url 'handyhelpers:show_all_list_view' %}" title="clear filters" class="ms-2"> | ||
<i class="fas fa-undo-alt"></i> | ||
</a> | ||
{% endif %} | ||
{% endif %} | ||
</div> | ||
|
||
{% include table %} | ||
</div> | ||
|
||
{% include 'handyhelpers/component/bs5/modals.htm' %} | ||
|
||
{# include generic modal form for the create object form if passed from the view #} | ||
{% with create_form as form_data %} | ||
{% include 'handyhelpers/generic/bs5/generic_modal_form.htm' %} | ||
{% endwith %} | ||
|
||
{# include generic modal form for the filter object form if passed from the view #} | ||
{% with filter_form as form_data %} | ||
{% include 'handyhelpers/generic/bs5/generic_modal_form.htm' %} | ||
{% endwith %} | ||
|
||
{# include custom modal html/js template if passed in from the view #} | ||
{% if modals %} | ||
{% include modals %} | ||
{% endif %} | ||
|
||
{# block for additional static content #} | ||
{% block additional_static %} | ||
{% if add_static %} | ||
{{ add_static|safe }} | ||
{% endif %} | ||
{% endblock additional_static %} | ||
|
||
{# block for additional template content #} | ||
{% block additional_template %} | ||
{% if add_template %} | ||
{% include add_template %} | ||
{% endif %} | ||
{% endblock additional_template %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
from django.urls import path | ||
|
||
from djangoaddicts.pygwalker.views import DynamicCsvPygWalkerView | ||
from djangoaddicts.pygwalker.views import DynamicCsvPygWalkerView, GenericPygWalkerView | ||
|
||
app_name = "pygwalker" | ||
|
||
urlpatterns = [ | ||
path("", DynamicCsvPygWalkerView.as_view(), name=""), | ||
path("csv", DynamicCsvPygWalkerView.as_view(), name="csv"), | ||
path("dynamic", DynamicCsvPygWalkerView.as_view(), name="dynamic"), | ||
path("file", DynamicCsvPygWalkerView.as_view(), name="file"), | ||
path("generic_pyg/<str:app_name>/<str:model_name>/", GenericPygWalkerView.as_view(), name="generic_pyg"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django import forms | ||
|
||
|
||
class TestForm(forms.Form): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.