django-pfx 1.4.dev56__tar.gz → 1.4.dev60__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/PKG-INFO +1 -1
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/django_pfx.egg-info/PKG-INFO +1 -1
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/locale/fr/LC_MESSAGES/django.po +3 -3
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/filters_views.py +14 -1
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/rest_views.py +10 -3
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/models.py +9 -1
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/basic_api_test.py +24 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/views.py +0 -5
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/.gitignore +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/.gitlab-ci.yml +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/.pre-commit-config.yaml +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/LICENSE +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/MANIFEST.in +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/README.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/django_pfx.egg-info/SOURCES.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/django_pfx.egg-info/dependency_links.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/django_pfx.egg-info/requires.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/django_pfx.egg-info/top_level.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/Makefile +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/conf.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/index.rst +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/api.views.rst +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/authentication.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/decorator.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/generate_openapi.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/getting_started.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/internationalisation.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/model.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/pfx_views.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/profiling.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/settings.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/doc/source/testing.md +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/img/pfx.png +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/img/pfx.svg +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/make_messages +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/manage.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/apidoc/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/apidoc/parameters.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/apidoc/schema.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/apidoc/tags.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/apps.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/decorator/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/decorator/rest.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/default_settings.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/exceptions.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/fields.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/http/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/http/json_response.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/locale/fr/LC_MESSAGES/django.mo +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/management/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/management/commands/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/management/commands/makeapidoc.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/management/commands/profile.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/middleware/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/middleware/authentication.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/middleware/locale.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/middleware/profiling.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/migrations/0001_initial.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/migrations/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/abstract_pfx_base_user.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/cache_mixins.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/login_ban.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/not_null_fields.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/otp_user_mixin.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/pfx_models.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/pfx_user.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/user_filtered_queryset_mixin.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/serializers/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/serializers/json.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/settings.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/shortcuts.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/storage/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/storage/s3_storage.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/otp_code_email.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/otp_code_subject.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/password_reset_email.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/password_reset_subject.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/welcome_email.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/welcome_subject.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/test.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/urls.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/authentication_views.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/fields.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/locale_views.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/date_format.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/groups.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/list_count.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/list_items.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/list_mode.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/list_order.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/list_search.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/media_redirect.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/meta_fields.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/meta_filters.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/meta_orders.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset_limit.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset_offset.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset_page.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset_page_size.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset_page_subset.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/settings/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/settings/dev.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pyproject.toml +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/requirements.txt +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/serve-doc +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/setup.cfg +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/setup.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/locale/fr/LC_MESSAGES/django.po +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/settings/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/settings/ci.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/settings/common.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/settings/dev.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/settings/dev_custom_example.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/settings/dev_default.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/__init__.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/basic_api_errors.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_api_doc.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_api_doc_search.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_auth_api.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_body_mixin.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_cache.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_client.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_fields.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_filters.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_locale_api.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_perm_tests.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_perms_api.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_profiling_middleware.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_settings.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_shortcuts.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_timezone_middleware.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_tools.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_user_queryset.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_view_decorators.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/tests/test_view_fields.py +0 -0
- {django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/tests/urls.py +0 -0
|
@@ -7,7 +7,7 @@ msgid ""
|
|
|
7
7
|
msgstr ""
|
|
8
8
|
"Project-Id-Version: \n"
|
|
9
9
|
"Report-Msgid-Bugs-To: \n"
|
|
10
|
-
"POT-Creation-Date: 2024-12-
|
|
10
|
+
"POT-Creation-Date: 2024-12-11 12:51+0100\n"
|
|
11
11
|
"PO-Revision-Date: 2021-06-22 23:31+0200\n"
|
|
12
12
|
"Last-Translator: \n"
|
|
13
13
|
"Language-Team: \n"
|
|
@@ -275,11 +275,11 @@ msgstr "{model} {obj} créé."
|
|
|
275
275
|
msgid "{model} {obj} updated."
|
|
276
276
|
msgstr "{model} {obj} modifié."
|
|
277
277
|
|
|
278
|
-
#: views/rest_views.py:
|
|
278
|
+
#: views/rest_views.py:1093
|
|
279
279
|
#, python-brace-format
|
|
280
280
|
msgid "{model} {obj} deleted."
|
|
281
281
|
msgstr "{model} {obj} supprimé."
|
|
282
282
|
|
|
283
|
-
#: views/rest_views.py:
|
|
283
|
+
#: views/rest_views.py:1185 views/rest_views.py:1225
|
|
284
284
|
msgid "Unexpected storage error"
|
|
285
285
|
msgstr "Erreur de stockage inattendue"
|
|
@@ -89,7 +89,20 @@ class Filter():
|
|
|
89
89
|
[self.filter_func(v) for v in values])
|
|
90
90
|
|
|
91
91
|
def _get_values(self, params):
|
|
92
|
-
values = [
|
|
92
|
+
values = []
|
|
93
|
+
if (self.type == FieldType.ModelObject and self.related_model and
|
|
94
|
+
hasattr(self.related_model.objects, 'default_search')):
|
|
95
|
+
q = None
|
|
96
|
+
for search in params.getlist(f'{self.name}*'):
|
|
97
|
+
crit = self.related_model.objects.default_search(search)
|
|
98
|
+
if q is None:
|
|
99
|
+
q = crit
|
|
100
|
+
q |= crit
|
|
101
|
+
if q:
|
|
102
|
+
values.extend(self.related_model.objects.filter(
|
|
103
|
+
q).values_list('pk', flat=True) or [-1])
|
|
104
|
+
values.extend([
|
|
105
|
+
self._parse_value(v) for v in params.getlist(self.name)])
|
|
93
106
|
return values or self.defaults
|
|
94
107
|
|
|
95
108
|
def query(self, params):
|
|
@@ -550,6 +550,8 @@ class ListRestViewMixin(ModelResponseMixin):
|
|
|
550
550
|
:returns: The django filters
|
|
551
551
|
:rtype: :class:`django.db.models.Q`
|
|
552
552
|
"""
|
|
553
|
+
if hasattr(self.model.objects, 'default_search'):
|
|
554
|
+
return self.model.objects.default_search(search)
|
|
553
555
|
return Q()
|
|
554
556
|
|
|
555
557
|
def orderable_fields(self, model, models=None):
|
|
@@ -629,9 +631,14 @@ class ListRestViewMixin(ModelResponseMixin):
|
|
|
629
631
|
:returns: The filtered queryset
|
|
630
632
|
:rtype: :class:`django.db.models.QuerySet`
|
|
631
633
|
"""
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
634
|
+
q = None
|
|
635
|
+
for search in self.request.GET.getlist('search'):
|
|
636
|
+
crit = self.search_filter(search)
|
|
637
|
+
if q is None:
|
|
638
|
+
q = crit
|
|
639
|
+
q |= crit
|
|
640
|
+
if q:
|
|
641
|
+
return qs.filter(q)
|
|
635
642
|
return qs
|
|
636
643
|
|
|
637
644
|
def get_order_mapping(self):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from django.contrib.auth.base_user import BaseUserManager
|
|
2
2
|
from django.core.mail import send_mail
|
|
3
3
|
from django.db import models
|
|
4
|
+
from django.db.models import Q
|
|
4
5
|
from django.utils.functional import cached_property
|
|
5
6
|
from django.utils.translation import gettext_lazy as _
|
|
6
7
|
|
|
@@ -96,6 +97,13 @@ class User(CacheableMixin, JSONReprMixin, OtpUserMixin, AbstractPFXBaseUser):
|
|
|
96
97
|
send_mail(subject, message, from_email, [self.email], **kwargs)
|
|
97
98
|
|
|
98
99
|
|
|
100
|
+
class AuthorQuerySet(models.QuerySet):
|
|
101
|
+
def default_search(self, search):
|
|
102
|
+
return (
|
|
103
|
+
Q(first_name__unaccent__icontains=search) |
|
|
104
|
+
Q(last_name__unaccent__icontains=search))
|
|
105
|
+
|
|
106
|
+
|
|
99
107
|
class BadUserAuthorQuerySet(UserFilteredQuerySetMixin, models.QuerySet):
|
|
100
108
|
pass
|
|
101
109
|
|
|
@@ -127,7 +135,7 @@ class Author(CacheableMixin, JSONReprMixin, models.Model):
|
|
|
127
135
|
'tests.BookType', related_name='authors',
|
|
128
136
|
verbose_name="Types")
|
|
129
137
|
|
|
130
|
-
objects =
|
|
138
|
+
objects = AuthorQuerySet.as_manager()
|
|
131
139
|
bad_user_objects = BadUserAuthorQuerySet.as_manager()
|
|
132
140
|
user_objects = UserAuthorQuerySet.as_manager()
|
|
133
141
|
|
|
@@ -197,6 +197,12 @@ class BasicAPITest(TestAssertMixin, TestCase):
|
|
|
197
197
|
self.assertJE(response, 'items.@0.gender.value', 'male')
|
|
198
198
|
self.assertJE(response, 'items.@0.gender.label', 'Male')
|
|
199
199
|
|
|
200
|
+
response = self.client.get(
|
|
201
|
+
'/api/authors?search=isaac&search=tolkien&items=1&count=1')
|
|
202
|
+
|
|
203
|
+
self.assertRC(response, 200)
|
|
204
|
+
self.assertJE(response, 'meta.count', 2)
|
|
205
|
+
|
|
200
206
|
def test_meta_list(self):
|
|
201
207
|
response = self.client.get('/api/authors/meta/list')
|
|
202
208
|
self.assertRC(response, 200)
|
|
@@ -483,6 +489,24 @@ class BasicAPITest(TestAssertMixin, TestCase):
|
|
|
483
489
|
self.assertTrue(
|
|
484
490
|
item['type'] is None or item['type']['pk'] == book_type.pk)
|
|
485
491
|
|
|
492
|
+
def test_model_filter_foreign_key_text_search(self):
|
|
493
|
+
response = self.client.get(
|
|
494
|
+
'/api/books?author*=asimov&items=1&count=1')
|
|
495
|
+
self.assertRC(response, 200)
|
|
496
|
+
self.assertJE(response, 'meta.count', 3)
|
|
497
|
+
|
|
498
|
+
# Test multiple values
|
|
499
|
+
response = self.client.get(
|
|
500
|
+
'/api/books?author*=asimov&author*=tolkien&items=1&count=1')
|
|
501
|
+
self.assertRC(response, 200)
|
|
502
|
+
self.assertJE(response, 'meta.count', 7)
|
|
503
|
+
|
|
504
|
+
# Test empty search
|
|
505
|
+
response = self.client.get(
|
|
506
|
+
'/api/books?author*=&items=1&count=1')
|
|
507
|
+
self.assertRC(response, 200)
|
|
508
|
+
self.assertJE(response, 'meta.count', 7)
|
|
509
|
+
|
|
486
510
|
def test_model_filter_char_choices(self):
|
|
487
511
|
response = self.client.get('/api/authors?gender=male&items=1&count=1')
|
|
488
512
|
|
|
@@ -80,11 +80,6 @@ class AuthorRestView(AuthorRestViewMixin, SlugDetailRestViewMixin, RestView):
|
|
|
80
80
|
]),
|
|
81
81
|
]
|
|
82
82
|
|
|
83
|
-
def search_filter(self, search):
|
|
84
|
-
return (
|
|
85
|
-
Q(first_name__unaccent__icontains=search) |
|
|
86
|
-
Q(last_name__unaccent__icontains=search))
|
|
87
|
-
|
|
88
83
|
@rest_api("/cache/<int:id>", method="get", groups=['cache'])
|
|
89
84
|
def cache_get(self, id, *args, **kwargs):
|
|
90
85
|
book = Author.cache_get(id)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/models/user_filtered_queryset_mixin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/otp_code_email.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/welcome_email.txt
RENAMED
|
File without changes
|
{django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/templates/registration/welcome_subject.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/media_redirect.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset_page_size.py
RENAMED
|
File without changes
|
{django_pfx-1.4.dev56 → django_pfx-1.4.dev60}/pfx/pfxcore/views/parameters/subset_page_subset.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|