From aaa217f47fc556f530d28fe20a94f8ce35431396 Mon Sep 17 00:00:00 2001 From: elapouya Date: Thu, 2 Jun 2022 17:31:45 +0200 Subject: [PATCH] Add example --- .../locale/en/LC_MESSAGES/django.po | 194 ++++++++++----- .../locale/fr/LC_MESSAGES/django.po | 226 ++++++++++++------ django_listing/paginators.py | 4 +- example/Pipfile | 12 + example/Pipfile.lock | 57 +++++ example/app/__init__.py | 0 example/app/asgi.py | 16 ++ example/app/settings.py | 125 ++++++++++ example/app/urls.py | 21 ++ example/app/wsgi.py | 16 ++ example/db.sqlite3 | 0 example/manage.py | 22 ++ setup.py | 4 +- 13 files changed, 560 insertions(+), 137 deletions(-) create mode 100644 example/Pipfile create mode 100644 example/Pipfile.lock create mode 100644 example/app/__init__.py create mode 100644 example/app/asgi.py create mode 100644 example/app/settings.py create mode 100644 example/app/urls.py create mode 100644 example/app/wsgi.py create mode 100644 example/db.sqlite3 create mode 100755 example/manage.py diff --git a/django_listing/locale/en/LC_MESSAGES/django.po b/django_listing/locale/en/LC_MESSAGES/django.po index abe4ec5..ad45f44 100644 --- a/django_listing/locale/en/LC_MESSAGES/django.po +++ b/django_listing/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-15 09:06+0200\n" +"POT-Creation-Date: 2022-06-02 15:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,275 +18,349 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: actions_buttons_column.py:132 +#: django_listing/actions_buttons_column.py:151 msgid "Move up" msgstr "" -#: actions_buttons_column.py:133 +#: django_listing/actions_buttons_column.py:152 msgid "Change order up" msgstr "" -#: actions_buttons_column.py:162 +#: django_listing/actions_buttons_column.py:180 msgid "Move down" msgstr "" -#: actions_buttons_column.py:163 +#: django_listing/actions_buttons_column.py:181 msgid "Change order down" msgstr "" -#: actions_buttons_column.py:192 +#: django_listing/actions_buttons_column.py:209 +#: django_listing/actions_buttons_column.py:220 msgid "Details" msgstr "" -#: actions_buttons_column.py:193 +#: django_listing/actions_buttons_column.py:210 +#: django_listing/actions_buttons_column.py:221 msgid "See details" msgstr "" -#: aggregations.py:46 +#: django_listing/actions_buttons_column.py:226 +msgid "Not set" +msgstr "" + +#: django_listing/actions_buttons_column.py:253 +msgid "You must specify a layout in view_object_popup__layout" +msgstr "" + +#: django_listing/actions_buttons_column.py:256 +msgid "Object id not specified !" +msgstr "" + +#: django_listing/actions_buttons_column.py:295 +msgid "*** Not a valid column name ***" +msgstr "" + +#: django_listing/aggregations.py:46 msgid "Unknown \"{}\" aggregation, choose one of these : {}" msgstr "" -#: aggregations.py:53 +#: django_listing/aggregations.py:53 #, python-brace-format msgid "{value}" msgstr "" -#: aggregations.py:136 +#: django_listing/aggregations.py:136 #, python-brace-format msgid "Total :
{value}" msgstr "" -#: aggregations.py:146 +#: django_listing/aggregations.py:146 #, python-brace-format msgid "Min :
{value}" msgstr "" -#: aggregations.py:156 +#: django_listing/aggregations.py:156 #, python-brace-format msgid "Max :
{value}" msgstr "" -#: aggregations.py:166 +#: django_listing/aggregations.py:166 #, python-brace-format msgid "Min : {min_val}
Max : {max_val}" msgstr "" -#: aggregations.py:178 +#: django_listing/aggregations.py:178 msgid "" "Min : {min_val}
Max : {max_val}
Avg : {avg_val:.{col.footer_precision}" "f}" msgstr "" -#: columns.py:105 +#: django_listing/columns.py:120 #, python-brace-format msgid "" "column {col_id} of listing {listing} is not a Column instance (class = " "{colclass})" msgstr "" -#: columns.py:270 +#: django_listing/columns.py:299 msgid "Please choose..." msgstr "" -#: columns.py:602 +#: django_listing/columns.py:632 msgid "{} is not a valid django forms field class" msgstr "" -#: columns.py:612 +#: django_listing/columns.py:642 msgid "{} is not a valid django forms widget class" msgstr "" -#: columns.py:644 filters.py:370 +#: django_listing/columns.py:674 django_listing/filters.py:376 #, python-brace-format msgid "" "Cannot find choices from model for filter \"{name}\", Please specify the " "choices to display" msgstr "" -#: columns.py:648 filters.py:374 +#: django_listing/columns.py:678 django_listing/filters.py:380 #, python-brace-format msgid "Please specify the choices to display for filter \"{name}\"" msgstr "" -#: columns.py:658 +#: django_listing/columns.py:688 msgid "True" msgstr "" -#: columns.py:659 +#: django_listing/columns.py:689 msgid "False" msgstr "" -#: columns.py:1019 +#: django_listing/columns.py:1086 msgid "Total" msgstr "" -#: columns.py:1021 +#: django_listing/columns.py:1088 #, python-brace-format msgid "Grand Total:
{value}" msgstr "" -#: columns.py:1030 +#: django_listing/columns.py:1097 msgid "Min" msgstr "" -#: columns.py:1032 +#: django_listing/columns.py:1099 #, python-brace-format msgid "Overall Min:
{value}" msgstr "" -#: columns.py:1040 +#: django_listing/columns.py:1107 msgid "Max" msgstr "" -#: columns.py:1042 +#: django_listing/columns.py:1109 #, python-brace-format msgid "Overall Max:
{value}" msgstr "" -#: columns.py:1051 +#: django_listing/columns.py:1118 msgid "Average" msgstr "" -#: columns.py:1056 +#: django_listing/columns.py:1123 msgid "Overall avg:
{value:.{col.footer_precision}f}" msgstr "" -#: filters.py:55 +#: django_listing/filters.py:55 msgctxt "Filters form" msgid "Reset" msgstr "" -#: filters.py:56 +#: django_listing/filters.py:56 msgctxt "Filters form" msgid "Filter" msgstr "" -#: filters.py:256 +#: django_listing/filters.py:206 +#, python-brace-format +msgid "Cannot find filter \"{name}\" definition" +msgstr "" + +#: django_listing/filters.py:262 msgid "- No filtering -" msgstr "" -#: filters.py:461 +#: django_listing/filters.py:467 msgid "Use CTRL+click to select/deselect multiple choices" msgstr "" -#: listing.py:304 -msgid "Nothing to display" +#: django_listing/listing.py:293 +msgctxt "action button" +msgid "Cancel" msgstr "" -#: listing.py:445 +#: django_listing/listing.py:294 +msgctxt "action button" +msgid "Edit" +msgstr "" + +#: django_listing/listing.py:295 +msgctxt "action button" +msgid "Update" +msgstr "" + +#: django_listing/listing.py:296 +msgctxt "action button" +msgid "Upload" +msgstr "" + +#: django_listing/listing.py:321 +msgid "Nothing to display" +msgstr "" + +#: django_listing/listing.py:499 msgid "Please configure at least one column in your listing" msgstr "" -#: listing.py:519 +#: django_listing/listing.py:576 msgid "record" msgstr "" -#: listing_form.py:73 +#: django_listing/listing_form.py:94 msgctxt "Listing form" msgid "Reset" msgstr "" -#: listing_form.py:74 +#: django_listing/listing_form.py:95 msgctxt "Listing form" msgid "Add" msgstr "" -#: listing_form.py:140 +#: django_listing/listing_form.py:161 msgid "You must specify a list of columns names in the form layout" msgstr "" -#: listing_form.py:147 +#: django_listing/listing_form.py:168 #, python-brace-format msgid "" "In the {form_name} layout you specified the field \"{field_name}\" but there " "is no existing listing column with that name" msgstr "" -#: paginators.py:32 +#: django_listing/paginators.py:33 #, python-brace-format msgctxt "paginator" msgid "Page {page_number} of {nb_pages}" msgstr "" -#: paginators.py:34 +#: django_listing/paginators.py:35 #, python-brace-format msgctxt "paginator" msgid "{row_first}-{row_last} of {nb_rows}" msgstr "" -#: paginators.py:36 +#: django_listing/paginators.py:37 msgctxt "paginator" msgid "Previous" msgstr "" -#: paginators.py:37 +#: django_listing/paginators.py:38 msgctxt "paginator" msgid "Next" msgstr "" -#: paginators.py:39 +#: django_listing/paginators.py:40 msgctxt "paginator" msgid "First" msgstr "" -#: paginators.py:40 +#: django_listing/paginators.py:41 msgctxt "paginator" msgid "Last" msgstr "" -#: paginators.py:51 +#: django_listing/paginators.py:52 #, python-brace-format msgctxt "paginator" msgid "Go to page {goto_form}" msgstr "" -#: record.py:42 +#: django_listing/record.py:48 msgid "" "Getting all records is only supported on SMALL sequence data, not on Django " "querysets" msgstr "" -#: record.py:79 +#: django_listing/record.py:101 #, python-brace-format msgid "" "field \"{field}\" must be an integer, please choose the correct field that " "will be used to change object ordering" msgstr "" -#: templates/django_listing/empty_listing.html:4 +#: django_listing/record.py:123 +msgid "Listing data must be a sequence or a QuerySet." +msgstr "" + +#: django_listing/templates/django_listing/empty_listing.html:4 #, python-format msgid "There is no %(record_label)s to display." msgstr "" -#: toolbar.py:175 +#: django_listing/toolbar.py:178 msgid "Sort by" msgstr "" -#: toolbar.py:176 toolbar.py:240 toolbar.py:278 +#: django_listing/toolbar.py:179 django_listing/toolbar.py:243 +#: django_listing/toolbar.py:281 msgid "OK" msgstr "" -#: toolbar.py:202 +#: django_listing/toolbar.py:205 msgid "Sort by..." msgstr "" -#: toolbar.py:239 +#: django_listing/toolbar.py:242 msgid "Per page" msgstr "" -#: toolbar.py:270 +#: django_listing/toolbar.py:273 msgid "Per page..." msgstr "" -#: toolbar.py:275 +#: django_listing/toolbar.py:278 msgid "Choose..." msgstr "" -#: toolbar.py:292 +#: django_listing/toolbar.py:295 msgid "Export to..." msgstr "" -#: views.py:191 +#: django_listing/toolbar.py:301 +msgid "Update" +msgstr "" + +#: django_listing/views.py:49 +#, python-brace-format +msgid "{object} has been successfully added." +msgstr "" + +#: django_listing/views.py:51 +msgid "" +"The form is valid but nothing has been added to database as " +"save_to_database=False." +msgstr "" + +#: django_listing/views.py:54 +#, python-brace-format +msgid "{nb_updates} {model_verbose} has been successfully updated." +msgstr "" + +#: django_listing/views.py:57 +msgid "" +"The form is valid but nothing has been updated to database as " +"save_to_database=False." +msgstr "" + +#: django_listing/views.py:270 msgid "" "At least a form layout and name are mandatory in POST data to build a " "relevant form instance" diff --git a/django_listing/locale/fr/LC_MESSAGES/django.po b/django_listing/locale/fr/LC_MESSAGES/django.po index 9e64359..6497c57 100644 --- a/django_listing/locale/fr/LC_MESSAGES/django.po +++ b/django_listing/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-15 09:06+0200\n" +"POT-Creation-Date: 2022-06-02 15:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,275 +18,355 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: actions_buttons_column.py:132 +#: django_listing/actions_buttons_column.py:151 msgid "Move up" -msgstr "" +msgstr "En haut" -#: actions_buttons_column.py:133 +#: django_listing/actions_buttons_column.py:152 msgid "Change order up" -msgstr "" +msgstr "Change l'ordre vers le haut" -#: actions_buttons_column.py:162 +#: django_listing/actions_buttons_column.py:180 msgid "Move down" -msgstr "" +msgstr "En bas" -#: actions_buttons_column.py:163 +#: django_listing/actions_buttons_column.py:181 msgid "Change order down" -msgstr "" +msgstr "Change l'ordre vers le bas" -#: actions_buttons_column.py:192 +#: django_listing/actions_buttons_column.py:209 +#: django_listing/actions_buttons_column.py:220 msgid "Details" -msgstr "" +msgstr "Détails" -#: actions_buttons_column.py:193 +#: django_listing/actions_buttons_column.py:210 +#: django_listing/actions_buttons_column.py:221 msgid "See details" -msgstr "" +msgstr "Voir les détails" -#: aggregations.py:46 +#: django_listing/actions_buttons_column.py:226 +msgid "Not set" +msgstr "Non défini" + +#: django_listing/actions_buttons_column.py:253 +msgid "You must specify a layout in view_object_popup__layout" +msgstr "Vous devez spécifier un layout dans view_object_popup__layout" + +#: django_listing/actions_buttons_column.py:256 +msgid "Object id not specified !" +msgstr "Object id non specifié !" + +#: django_listing/actions_buttons_column.py:295 +msgid "*** Not a valid column name ***" +msgstr "*** Nom de colonne invalide ***" + +#: django_listing/aggregations.py:46 msgid "Unknown \"{}\" aggregation, choose one of these : {}" -msgstr "" +msgstr "aggrégation \"{}\" inconnue, choisir une de celles-ci : {}" -#: aggregations.py:53 +#: django_listing/aggregations.py:53 #, python-brace-format msgid "{value}" msgstr "" -#: aggregations.py:136 +#: django_listing/aggregations.py:136 #, python-brace-format msgid "Total :
{value}" msgstr "" -#: aggregations.py:146 +#: django_listing/aggregations.py:146 #, python-brace-format msgid "Min :
{value}" msgstr "" -#: aggregations.py:156 +#: django_listing/aggregations.py:156 #, python-brace-format msgid "Max :
{value}" msgstr "" -#: aggregations.py:166 +#: django_listing/aggregations.py:166 #, python-brace-format msgid "Min : {min_val}
Max : {max_val}" msgstr "" -#: aggregations.py:178 +#: django_listing/aggregations.py:178 msgid "" "Min : {min_val}
Max : {max_val}
Avg : {avg_val:.{col.footer_precision}" "f}" msgstr "" +"Min : {min_val}
Max : {max_val}
Moy : {avg_val:.{col.footer_precision}" +"f}" -#: columns.py:105 +#: django_listing/columns.py:120 #, python-brace-format msgid "" "column {col_id} of listing {listing} is not a Column instance (class = " "{colclass})" msgstr "" +"colunne {col_id} du listing {listing} n'est pas une instance de Column (class = " +"{colclass})" -#: columns.py:270 +#: django_listing/columns.py:299 msgid "Please choose..." -msgstr "" +msgstr "Choisir..." -#: columns.py:602 +#: django_listing/columns.py:632 msgid "{} is not a valid django forms field class" -msgstr "" +msgstr "{} n'est pas une classs de champs de formulaire django valide" -#: columns.py:612 +#: django_listing/columns.py:642 msgid "{} is not a valid django forms widget class" -msgstr "" +msgstr "{} n'est pas une classe de widget de formulaire django valide" -#: columns.py:644 filters.py:370 +#: django_listing/columns.py:674 django_listing/filters.py:376 #, python-brace-format msgid "" "Cannot find choices from model for filter \"{name}\", Please specify the " "choices to display" msgstr "" +"Ne trouve pas 'choices' du modèle de filtrage \"{name}\", merçi de spécifier " +"les choix à afficher" -#: columns.py:648 filters.py:374 +#: django_listing/columns.py:678 django_listing/filters.py:380 #, python-brace-format msgid "Please specify the choices to display for filter \"{name}\"" msgstr "" -#: columns.py:658 +#: django_listing/columns.py:688 msgid "True" msgstr "" -#: columns.py:659 +#: django_listing/columns.py:689 msgid "False" msgstr "" -#: columns.py:1019 +#: django_listing/columns.py:1086 msgid "Total" msgstr "" -#: columns.py:1021 +#: django_listing/columns.py:1088 #, python-brace-format msgid "Grand Total:
{value}" msgstr "" -#: columns.py:1030 +#: django_listing/columns.py:1097 msgid "Min" msgstr "" -#: columns.py:1032 +#: django_listing/columns.py:1099 #, python-brace-format msgid "Overall Min:
{value}" msgstr "" -#: columns.py:1040 +#: django_listing/columns.py:1107 msgid "Max" msgstr "" -#: columns.py:1042 +#: django_listing/columns.py:1109 #, python-brace-format msgid "Overall Max:
{value}" msgstr "" -#: columns.py:1051 +#: django_listing/columns.py:1118 msgid "Average" msgstr "" -#: columns.py:1056 +#: django_listing/columns.py:1123 msgid "Overall avg:
{value:.{col.footer_precision}f}" msgstr "" -#: filters.py:55 +#: django_listing/filters.py:55 msgctxt "Filters form" msgid "Reset" msgstr "" -#: filters.py:56 +#: django_listing/filters.py:56 msgctxt "Filters form" msgid "Filter" msgstr "" -#: filters.py:256 +#: django_listing/filters.py:206 +#, python-brace-format +msgid "Cannot find filter \"{name}\" definition" +msgstr "" + +#: django_listing/filters.py:262 msgid "- No filtering -" msgstr "" -#: filters.py:461 +#: django_listing/filters.py:467 msgid "Use CTRL+click to select/deselect multiple choices" msgstr "" -#: listing.py:304 -msgid "Nothing to display" +#: django_listing/listing.py:293 +msgctxt "action button" +msgid "Cancel" +msgstr "" + +#: django_listing/listing.py:294 +msgctxt "action button" +msgid "Edit" +msgstr "" + +#: django_listing/listing.py:295 +msgctxt "action button" +msgid "Update" msgstr "" -#: listing.py:445 +#: django_listing/listing.py:296 +msgctxt "action button" +msgid "Upload" +msgstr "" + +#: django_listing/listing.py:321 +msgid "Nothing to display" +msgstr "" + +#: django_listing/listing.py:499 msgid "Please configure at least one column in your listing" msgstr "" -#: listing.py:519 +#: django_listing/listing.py:576 msgid "record" msgstr "" -#: listing_form.py:73 +#: django_listing/listing_form.py:94 msgctxt "Listing form" msgid "Reset" msgstr "" -#: listing_form.py:74 +#: django_listing/listing_form.py:95 msgctxt "Listing form" msgid "Add" msgstr "" -#: listing_form.py:140 +#: django_listing/listing_form.py:161 msgid "You must specify a list of columns names in the form layout" msgstr "" -#: listing_form.py:147 +#: django_listing/listing_form.py:168 #, python-brace-format msgid "" "In the {form_name} layout you specified the field \"{field_name}\" but there " "is no existing listing column with that name" msgstr "" -#: paginators.py:32 +#: django_listing/paginators.py:33 #, python-brace-format msgctxt "paginator" msgid "Page {page_number} of {nb_pages}" -msgstr "" +msgstr "Page {page_number} sur {nb_pages}" -#: paginators.py:34 +#: django_listing/paginators.py:35 #, python-brace-format msgctxt "paginator" msgid "{row_first}-{row_last} of {nb_rows}" -msgstr "" +msgstr "{row_first}-{row_last} sur {nb_rows}" -#: paginators.py:36 +#: django_listing/paginators.py:37 msgctxt "paginator" msgid "Previous" msgstr "" -#: paginators.py:37 +#: django_listing/paginators.py:38 msgctxt "paginator" msgid "Next" msgstr "" -#: paginators.py:39 +#: django_listing/paginators.py:40 msgctxt "paginator" msgid "First" msgstr "" -#: paginators.py:40 +#: django_listing/paginators.py:41 msgctxt "paginator" msgid "Last" msgstr "" -#: paginators.py:51 +#: django_listing/paginators.py:52 #, python-brace-format msgctxt "paginator" msgid "Go to page {goto_form}" msgstr "" -#: record.py:42 +#: django_listing/record.py:48 msgid "" "Getting all records is only supported on SMALL sequence data, not on Django " "querysets" msgstr "" -#: record.py:79 +#: django_listing/record.py:101 #, python-brace-format msgid "" "field \"{field}\" must be an integer, please choose the correct field that " "will be used to change object ordering" msgstr "" -#: templates/django_listing/empty_listing.html:4 +#: django_listing/record.py:123 +msgid "Listing data must be a sequence or a QuerySet." +msgstr "" + +#: django_listing/templates/django_listing/empty_listing.html:4 #, python-format msgid "There is no %(record_label)s to display." msgstr "" -#: toolbar.py:175 +#: django_listing/toolbar.py:178 msgid "Sort by" msgstr "" -#: toolbar.py:176 toolbar.py:240 toolbar.py:278 +#: django_listing/toolbar.py:179 django_listing/toolbar.py:243 +#: django_listing/toolbar.py:281 msgid "OK" msgstr "" -#: toolbar.py:202 +#: django_listing/toolbar.py:205 msgid "Sort by..." msgstr "" -#: toolbar.py:239 +#: django_listing/toolbar.py:242 msgid "Per page" -msgstr "" +msgstr "Par page" -#: toolbar.py:270 +#: django_listing/toolbar.py:273 msgid "Per page..." msgstr "" -#: toolbar.py:275 +#: django_listing/toolbar.py:278 msgid "Choose..." msgstr "" -#: toolbar.py:292 +#: django_listing/toolbar.py:295 msgid "Export to..." msgstr "" -#: views.py:191 +#: django_listing/toolbar.py:301 +msgid "Update" +msgstr "" + +#: django_listing/views.py:49 +#, python-brace-format +msgid "{object} has been successfully added." +msgstr "" + +#: django_listing/views.py:51 +msgid "" +"The form is valid but nothing has been added to database as " +"save_to_database=False." +msgstr "" + +#: django_listing/views.py:54 +#, python-brace-format +msgid "{nb_updates} {model_verbose} has been successfully updated." +msgstr "" + +#: django_listing/views.py:57 +msgid "" +"The form is valid but nothing has been updated to database as " +"save_to_database=False." +msgstr "" + +#: django_listing/views.py:270 msgid "" "At least a form layout and name are mandatory in POST data to build a " "relevant form instance" diff --git a/django_listing/paginators.py b/django_listing/paginators.py index a1ce2b4..ffc3cca 100644 --- a/django_listing/paginators.py +++ b/django_listing/paginators.py @@ -30,9 +30,9 @@ class Paginator(DjangoPaginator): template_name = 'django_listing/paginator.html' has_page_info = True has_editable_page_info = False - page_info_tpl = pgettext_lazy('paginator','Page {page_number} of {nb_pages}') + page_info_tpl = pgettext_lazy('paginator', 'Page {page_number} of {nb_pages}') has_row_info = False - row_info_tpl = pgettext_lazy('paginator','{row_first}-{row_last} of {nb_rows}') + row_info_tpl = pgettext_lazy('paginator', '{row_first}-{row_last} of {nb_rows}') has_prev_next = True prev_text = pgettext_lazy('paginator','Previous') next_text = pgettext_lazy('paginator','Next') diff --git a/example/Pipfile b/example/Pipfile new file mode 100644 index 0000000..289100a --- /dev/null +++ b/example/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +django-listing = {editable = true, path = "./.."} + +[dev-packages] + +[requires] +python_version = "3.10" diff --git a/example/Pipfile.lock b/example/Pipfile.lock new file mode 100644 index 0000000..2525966 --- /dev/null +++ b/example/Pipfile.lock @@ -0,0 +1,57 @@ +{ + "_meta": { + "hash": { + "sha256": "fb8bfd79536a6df9a5c8ed242895073741c2f20f1f1bf24a87641a339e8a3686" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.10" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "asgiref": { + "hashes": [ + "sha256:1d2880b792ae8757289136f1db2b7b99100ce959b2aa57fd69dab783d05afac4", + "sha256:4a29362a6acebe09bf1d6640db38c1dc3d9217c68e6f9f6204d72667fc19a424" + ], + "markers": "python_version >= '3.7'", + "version": "==3.5.2" + }, + "django": { + "hashes": [ + "sha256:502ae42b6ab1b612c933fb50d5ff850facf858a4c212f76946ecd8ea5b3bf2d9", + "sha256:f7431a5de7277966f3785557c3928433347d998c1e6459324501378a291e5aab" + ], + "markers": "python_version >= '3.8'", + "version": "==4.0.5" + }, + "django-listing": { + "editable": true, + "path": "./.." + }, + "sqlparse": { + "hashes": [ + "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae", + "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d" + ], + "markers": "python_version >= '3.5'", + "version": "==0.4.2" + }, + "tablib": { + "hashes": [ + "sha256:870d7e688f738531a14937a055e8bba404fbc388e77d4d500b2c904075d1019c", + "sha256:a57f2770b8c225febec1cb1e65012a69cf30dd28be810e0ff98d024768c7d0f1" + ], + "markers": "python_version >= '3.7'", + "version": "==3.2.1" + } + }, + "develop": {} +} diff --git a/example/app/__init__.py b/example/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/example/app/asgi.py b/example/app/asgi.py new file mode 100644 index 0000000..3163a3a --- /dev/null +++ b/example/app/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for app project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings') + +application = get_asgi_application() diff --git a/example/app/settings.py b/example/app/settings.py new file mode 100644 index 0000000..644df4d --- /dev/null +++ b/example/app/settings.py @@ -0,0 +1,125 @@ +""" +Django settings for app project. + +Generated by 'django-admin startproject' using Django 4.0.5. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-%+(ybkl-6*-y_*uk@j6f8p)x@xd=p@id@h_8t+2_kib2=j#a@t' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django_listing', + 'app', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'app.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'app.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/example/app/urls.py b/example/app/urls.py new file mode 100644 index 0000000..1e0fd9a --- /dev/null +++ b/example/app/urls.py @@ -0,0 +1,21 @@ +"""app URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/example/app/wsgi.py b/example/app/wsgi.py new file mode 100644 index 0000000..0efb709 --- /dev/null +++ b/example/app/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for app project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings') + +application = get_wsgi_application() diff --git a/example/db.sqlite3 b/example/db.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/example/manage.py b/example/manage.py new file mode 100755 index 0000000..4931389 --- /dev/null +++ b/example/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/setup.py b/setup.py index 71b4d50..38331e5 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup,find_packages +from setuptools import setup, find_packages import os import re @@ -62,7 +62,7 @@ def get_version(pkg): author='Eric Lapouyade', author_email='elapouya@gmail.com', license='GPLv3+', - packages=find_packages(exclude=['docs.*','docs']), + packages=find_packages(exclude=['docs.*', 'example.*', 'example', 'docs']), include_package_data=True, install_requires=['django>=2', 'tablib'], extras_require={