django-pfx 1.2.dev34__tar.gz → 1.2.dev36__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.2.dev34 → django-pfx-1.2.dev36}/PKG-INFO +1 -1
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/django_pfx.egg-info/PKG-INFO +1 -1
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/views/rest_views.py +8 -2
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_api_doc.py +23 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/.gitignore +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/.gitlab-ci.yml +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/.pre-commit-config.yaml +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/LICENSE +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/MANIFEST.in +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/README.md +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/django_pfx.egg-info/SOURCES.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/django_pfx.egg-info/dependency_links.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/django_pfx.egg-info/requires.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/django_pfx.egg-info/top_level.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/img/pfx.png +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/img/pfx.svg +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/apps.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/decorator/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/decorator/rest.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/default_settings.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/exceptions.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/fields.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/http/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/http/json_response.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/locale/fr/LC_MESSAGES/django.mo +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/locale/fr/LC_MESSAGES/django.po +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/management/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/management/commands/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/management/commands/makeapidoc.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/middleware/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/middleware/authentication.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/middleware/locale.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/models/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/models/cache_mixins.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/models/not_null_fields.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/models/pfx_models.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/models/user_filtered_queryset_mixin.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/serializers/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/serializers/json.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/settings.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/shortcuts.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/storage/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/storage/s3_storage.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/templates/registration/password_reset_email.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/templates/registration/password_reset_subject.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/templates/registration/welcome_email.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/templates/registration/welcome_subject.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/test.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/urls.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/views/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/views/authentication_views.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/views/fields.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/views/filters_views.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/views/locale_views.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pyproject.toml +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/requirements.txt +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/runtest.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/setup.cfg +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/setup.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/models.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/settings/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/settings/ci.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/settings/common.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/settings/dev.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/settings/dev_custom_example.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/settings/dev_default.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/__init__.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/basic_api_errors.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/basic_api_test.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_auth_api.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_cache.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_fields.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_filters.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_locale_api.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_perm_tests.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_perms_api.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_shortcuts.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_timezone_middleware.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_tools.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_user_queryset.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_view_decorators.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/tests/test_view_fields.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/urls.py +0 -0
- {django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/tests/views.py +0 -0
|
@@ -551,7 +551,7 @@ class BaseRestView(SecuredRestViewMixin, View):
|
|
|
551
551
|
process, path.lstrip('/').split('/'))
|
|
552
552
|
|
|
553
553
|
@classmethod
|
|
554
|
-
def
|
|
554
|
+
def get_urls(cls, as_pattern=False):
|
|
555
555
|
def fullpath(p2):
|
|
556
556
|
return f'{cls.rest_view_path}{p2}'.lstrip('/')
|
|
557
557
|
|
|
@@ -568,11 +568,17 @@ class BaseRestView(SecuredRestViewMixin, View):
|
|
|
568
568
|
"you cannot set different priority for same path")
|
|
569
569
|
methods['priority'] = m.rest_api_priority
|
|
570
570
|
return [
|
|
571
|
-
path(fullpath(p), cls.as_view(pfx_methods=ms))
|
|
571
|
+
path(fullpath(p), cls.as_view(pfx_methods=ms)) if as_pattern
|
|
572
|
+
else dict(path=fullpath(p), methods={
|
|
573
|
+
k: v for k, v in ms.items() if k != 'priority'})
|
|
572
574
|
for p, ms in sorted(
|
|
573
575
|
paths.items(), key=lambda e: cls._path_order(*e),
|
|
574
576
|
reverse=True)]
|
|
575
577
|
|
|
578
|
+
@classmethod
|
|
579
|
+
def as_urlpatterns(cls):
|
|
580
|
+
return cls.get_urls(as_pattern=True)
|
|
581
|
+
|
|
576
582
|
|
|
577
583
|
class RestView(
|
|
578
584
|
ListRestViewMixin,
|
|
@@ -2,6 +2,7 @@ from django.test import TestCase, override_settings
|
|
|
2
2
|
|
|
3
3
|
from pfx.pfxcore.management.commands.makeapidoc import get_spec
|
|
4
4
|
from pfx.pfxcore.test import TestAssertMixin
|
|
5
|
+
from tests.views import AuthorRestView
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class ApiDocTest(TestAssertMixin, TestCase):
|
|
@@ -22,3 +23,25 @@ class ApiDocTest(TestAssertMixin, TestCase):
|
|
|
22
23
|
self.assertEqual(info['title'], "MyAPI")
|
|
23
24
|
self.assertEqual(info['version'], "1.0.0")
|
|
24
25
|
self.assertEqual(info['description'], "A test API")
|
|
26
|
+
|
|
27
|
+
def test_view_get_urls(self):
|
|
28
|
+
def get_methods(url, p):
|
|
29
|
+
return next(filter(lambda u: u['path'] == p, urls))['methods']
|
|
30
|
+
|
|
31
|
+
urls = AuthorRestView.get_urls()
|
|
32
|
+
|
|
33
|
+
# Methods from RestView
|
|
34
|
+
self.assertEqual(
|
|
35
|
+
get_methods(urls, 'authors'),
|
|
36
|
+
dict(get='get_list', post='post'))
|
|
37
|
+
self.assertEqual(
|
|
38
|
+
get_methods(urls, 'authors/<int:id>'),
|
|
39
|
+
dict(delete='delete', get='get', put='put'))
|
|
40
|
+
# A method from SlugDetailRestViewMixin
|
|
41
|
+
self.assertEqual(
|
|
42
|
+
get_methods(urls, 'authors/slug/<slug:slug>'),
|
|
43
|
+
dict(get='get_by_slug'))
|
|
44
|
+
# A method from AuthorRestView itself
|
|
45
|
+
self.assertEqual(
|
|
46
|
+
get_methods(urls, 'authors/cache/<int:id>'),
|
|
47
|
+
dict(get='cache_get'))
|
|
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.2.dev34 → django-pfx-1.2.dev36}/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
|
|
File without changes
|
|
File without changes
|
{django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/pfx/pfxcore/templates/registration/welcome_email.txt
RENAMED
|
File without changes
|
{django-pfx-1.2.dev34 → django-pfx-1.2.dev36}/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
|
|
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
|