djgentelella 0.3.25__py3-none-any.whl → 0.3.27__py3-none-any.whl
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.
- djgentelella/__init__.py +1 -1
- djgentelella/blog/tests/test_entry_forms.py +4 -4
- djgentelella/static/gentelella/js/base/form.common.js +195 -82
- djgentelella/static/gentelella/js/base/formset.js +102 -83
- djgentelella/static/gentelella/js/base.js +294 -162
- djgentelella/templates/gentelella/blocks/listcard_template.html +2 -2
- djgentelella/tests/Calendar_Test.py +3 -3
- djgentelella/tests/Notification_Test.py +13 -18
- djgentelella/tests/fields/files.py +3 -5
- djgentelella/views/listAreaViewset.py +17 -1
- {djgentelella-0.3.25.dist-info → djgentelella-0.3.27.dist-info}/METADATA +1 -3
- {djgentelella-0.3.25.dist-info → djgentelella-0.3.27.dist-info}/RECORD +16 -16
- {djgentelella-0.3.25.dist-info → djgentelella-0.3.27.dist-info}/WHEEL +1 -1
- {djgentelella-0.3.25.dist-info → djgentelella-0.3.27.dist-info}/AUTHORS +0 -0
- {djgentelella-0.3.25.dist-info → djgentelella-0.3.27.dist-info}/LICENSE.txt +0 -0
- {djgentelella-0.3.25.dist-info → djgentelella-0.3.27.dist-info}/top_level.txt +0 -0
|
@@ -1,31 +1,29 @@
|
|
|
1
|
+
import datetime
|
|
1
2
|
import re
|
|
2
3
|
import uuid
|
|
3
|
-
import datetime
|
|
4
4
|
|
|
5
|
-
import pytz
|
|
6
5
|
from django.conf import settings
|
|
7
|
-
from django.test import TestCase, RequestFactory
|
|
8
6
|
from django.contrib.auth.models import User
|
|
9
7
|
from django.test import Client
|
|
8
|
+
from django.test import TestCase, RequestFactory
|
|
10
9
|
from django.urls import reverse
|
|
11
10
|
from django.utils import formats
|
|
12
|
-
|
|
13
|
-
from
|
|
14
|
-
from
|
|
11
|
+
from django.utils.timezone import now
|
|
12
|
+
from rest_framework import status
|
|
13
|
+
from rest_framework.exceptions import NotFound, NotAuthenticated
|
|
14
|
+
from rest_framework.pagination import PageNumberPagination
|
|
15
|
+
from rest_framework.test import APIClient
|
|
15
16
|
|
|
16
17
|
from demoapp.views import create_notification
|
|
17
|
-
from
|
|
18
|
+
from djgentelella.models import Notification
|
|
18
19
|
from djgentelella.notification.base import NotificationViewSet
|
|
19
|
-
from rest_framework.test import APIClient
|
|
20
|
-
from rest_framework_datatables.pagination import DatatablesPageNumberPagination
|
|
21
|
-
from rest_framework.exceptions import NotFound, NotAuthenticated
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
class ApiNotificationsTestCase(TestCase):
|
|
25
23
|
def setUp(self):
|
|
26
24
|
self.api_client = APIClient()
|
|
27
25
|
self.client = Client()
|
|
28
|
-
NotificationViewSet.pagination_class =
|
|
26
|
+
NotificationViewSet.pagination_class = PageNumberPagination
|
|
29
27
|
self.factory = RequestFactory()
|
|
30
28
|
self.first_user = User.objects.create_superuser(
|
|
31
29
|
username='first_user', password='fuser123')
|
|
@@ -238,9 +236,8 @@ class ApiNotificationsTestCase(TestCase):
|
|
|
238
236
|
self.assertEqual(result['recordsTotal'], total_expected)
|
|
239
237
|
|
|
240
238
|
def test_creation_date_input_filter_returns_one_record(self):
|
|
241
|
-
start_date = datetime.
|
|
242
|
-
|
|
243
|
-
end_date = datetime.datetime.now(pytz.timezone(TIME_ZONE))
|
|
239
|
+
start_date = now() + datetime.timedelta(-3)
|
|
240
|
+
end_date = now()
|
|
244
241
|
user_notification = Notification.objects.filter(user=self.third_user)[0]
|
|
245
242
|
user_notification.creation_date += datetime.timedelta(-2)
|
|
246
243
|
user_notification.save()
|
|
@@ -268,10 +265,8 @@ class ApiNotificationsTestCase(TestCase):
|
|
|
268
265
|
self.assertEqual(result['recordsTotal'], total_expected)
|
|
269
266
|
|
|
270
267
|
def test_creation_date_input_filter_returns_no_records(self):
|
|
271
|
-
start_date = datetime.
|
|
272
|
-
|
|
273
|
-
end_date = datetime.datetime.now(
|
|
274
|
-
pytz.timezone(TIME_ZONE)) + datetime.timedelta(-2)
|
|
268
|
+
start_date = now() + datetime.timedelta(-3)
|
|
269
|
+
end_date = now() + datetime.timedelta(-2)
|
|
275
270
|
|
|
276
271
|
range_datetime = start_date.strftime(
|
|
277
272
|
formats.get_format('DATETIME_INPUT_FORMATS')[0]) + ' - ' + \
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import base64
|
|
2
|
-
|
|
3
1
|
from django.core.files.base import ContentFile
|
|
4
2
|
from django.test import TestCase
|
|
5
3
|
from rest_framework import serializers
|
|
@@ -12,11 +10,11 @@ class GTBase64FileFieldTestCase(TestCase):
|
|
|
12
10
|
field = GTBase64FileField()
|
|
13
11
|
data = {
|
|
14
12
|
"name": "test.txt",
|
|
15
|
-
"value":
|
|
13
|
+
"value": 'VGVzdCBjb250ZW50',
|
|
16
14
|
}
|
|
17
|
-
expected_content = ContentFile(b"Test content")
|
|
15
|
+
expected_content = ContentFile(b"Test content", name="test.txt")
|
|
18
16
|
|
|
19
|
-
result = field.to_internal_value(data)
|
|
17
|
+
result = field.to_internal_value([data])
|
|
20
18
|
|
|
21
19
|
self.assertEqual(result.read(), expected_content.read())
|
|
22
20
|
self.assertEqual(result.name, expected_content.name)
|
|
@@ -11,15 +11,30 @@ from djgentelella.serializers.paginators import PageListPagination
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class ListAreaViewset(mixins.ListModelMixin, GenericViewSet):
|
|
14
|
+
DISTRIBUTE = {
|
|
15
|
+
"1": ("", "p-3"),
|
|
16
|
+
"1/1": ("col-md-6", "col-md-6 p-3 p-md-0"),
|
|
17
|
+
"2/1": ("col-md-8", "col-md-4 p-3 p-md-0"),
|
|
18
|
+
"3/1": ("col-md-9", "col-md-3 p-3 p-md-0"),
|
|
19
|
+
"1/1p": ("col-md-6", "col-md-6 p-0 p-md-3"),
|
|
20
|
+
"2/1p": ("col-md-8", "col-md-4 p-0 p-md-3"),
|
|
21
|
+
"3/1p": ("col-md-9", "col-md-3 p-0 p-md-3"),
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
pagination_class = PageListPagination
|
|
15
25
|
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
|
|
16
26
|
template_name = 'gentelella/blocks/listcard_template.html'
|
|
17
27
|
filter_form = None
|
|
18
28
|
pagination_top = True
|
|
29
|
+
distribution_value = "1/1"
|
|
19
30
|
with_actions = True
|
|
20
31
|
extra_template_context = None
|
|
21
32
|
html_id = None
|
|
22
33
|
|
|
34
|
+
|
|
35
|
+
def distribution(self):
|
|
36
|
+
return self.DISTRIBUTE.get(self.distribution_value, ("col-md-6", "col-md-6"))
|
|
37
|
+
|
|
23
38
|
def get_html_id(self):
|
|
24
39
|
if self.html_id:
|
|
25
40
|
return self.html_id
|
|
@@ -58,7 +73,8 @@ class ListAreaViewset(mixins.ListModelMixin, GenericViewSet):
|
|
|
58
73
|
'with_actions': self.with_actions,
|
|
59
74
|
'id': self.get_html_id(),
|
|
60
75
|
'page_size_options': self.get_page_size_options(request),
|
|
61
|
-
'form': self.get_filter_form(request)
|
|
76
|
+
'form': self.get_filter_form(request),
|
|
77
|
+
'distribution': self.distribution()}
|
|
62
78
|
if self.extra_template_context:
|
|
63
79
|
context.update(self.extra_template_context)
|
|
64
80
|
rendered_template = render_to_string(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: djgentelella
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.27
|
|
4
4
|
Summary: Help building extra widgets for forms and speciall methods to render forms in templates
|
|
5
5
|
Home-page: https://solvosoft.com
|
|
6
6
|
Author: Luis Zarate Montero
|
|
@@ -385,8 +385,6 @@ Requires-Dist: djangorestframework>=3.13
|
|
|
385
385
|
Requires-Dist: django>=3.2
|
|
386
386
|
Requires-Dist: django_filter>=22.1
|
|
387
387
|
Provides-Extra: test
|
|
388
|
-
Requires-Dist: selenium==4.5.0; extra == "test"
|
|
389
|
-
Requires-Dist: selenium-screenshot==2.0.0; extra == "test"
|
|
390
388
|
Provides-Extra: dev
|
|
391
389
|
Requires-Dist: pylp; extra == "dev"
|
|
392
390
|
Requires-Dist: pylpconcat; extra == "dev"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
djgentelella/__init__.py,sha256=
|
|
1
|
+
djgentelella/__init__.py,sha256=_0CsejgIR80QliWjJp7-finlWzRg0QEPLNIZjZeoix0,23
|
|
2
2
|
djgentelella/admin.py,sha256=Wk-InJLUomexhr7Srw4dh3ZODB5i5RVyq1ukvoRvx-0,1304
|
|
3
3
|
djgentelella/apps.py,sha256=5VEbpUv4b1Jh7gCRAQCe5TvpakRyndKwafjVj0z-Xfo,153
|
|
4
4
|
djgentelella/chartjs.py,sha256=iNYoFnaIQoXsYInJFbSE2quWpjmDz5CuMKpVsvt4pRM,8572
|
|
@@ -31,7 +31,7 @@ djgentelella/blog/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
|
31
31
|
djgentelella/blog/templatetags/blog_tags.py,sha256=OmKY6ARbh9dRtOnsZO9oWerhbjH7zR-jfIdIGGrGJ4Q,621
|
|
32
32
|
djgentelella/blog/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
djgentelella/blog/tests/test_entry_detail.py,sha256=BTlzwAQQoY-ZWcFQW4-fUDyHO6gqwP2jvFeIYyPcnvM,849
|
|
34
|
-
djgentelella/blog/tests/test_entry_forms.py,sha256=
|
|
34
|
+
djgentelella/blog/tests/test_entry_forms.py,sha256=uO99lOqu9dZkOYBsFLidwSypjkcp6kzni2MkZmAr6Xk,1979
|
|
35
35
|
djgentelella/blog/tests/test_entry_listing.py,sha256=ux3tPe6CSFq_tSTuYVcG4SQZoU3-KmCDEoFt38Dq-VA,1046
|
|
36
36
|
djgentelella/blog/tests/test_models.py,sha256=K0KlaJjeuil2rurkad5N5Y4rJW0X-iaO8fU2UjDKiOY,4147
|
|
37
37
|
djgentelella/blog/tests/test_sitemaps.py,sha256=EzMSVpj6ZVVDeYWtUAz8d7xhPuD1Zkz_PAaQevCUG3Q,1299
|
|
@@ -121,7 +121,7 @@ djgentelella/static/gentelella/images/forward_disabled.png,sha256=7enxADzvJa3VzC
|
|
|
121
121
|
djgentelella/static/gentelella/images/forward_enabled.png,sha256=vLOxO1qvkBV2ev931iHx-VV63NjrgoTQbwtR4kdVVrA,1380
|
|
122
122
|
djgentelella/static/gentelella/images/forward_enabled_hover.png,sha256=T6LWiaYzcT2fuJAGEaZGxd8Lok3rlZerlVxiy6d647Q,1379
|
|
123
123
|
djgentelella/static/gentelella/images/loading.gif,sha256=dyCz9kckQBZKy7DpKpR3hL4xgQgnShbMue3Ao9h_lK0,30269
|
|
124
|
-
djgentelella/static/gentelella/js/base.js,sha256=
|
|
124
|
+
djgentelella/static/gentelella/js/base.js,sha256=g4B7NZdniNJmAb4rszA80WK4paP-ppIf20zRl3mcIoc,87448
|
|
125
125
|
djgentelella/static/gentelella/js/custom.js,sha256=O9GWx1FbkMYzbUSzlYw3SrfZrf9xPdMokPh91xMtdUY,14922
|
|
126
126
|
djgentelella/static/gentelella/js/datatables.js,sha256=cAp5D5OuN2oT-XW048XqkOZDJtPJefl2e36NNkrSN1M,12215
|
|
127
127
|
djgentelella/static/gentelella/js/obj_api_management.js,sha256=_RYQwzuB7QsNMCOQX4jKv9wGfTXIW0yFaaeTls4QqEo,29534
|
|
@@ -136,8 +136,8 @@ djgentelella/static/gentelella/js/base/custom.widgets.js,sha256=bMcE6gNNn9AABlZN
|
|
|
136
136
|
djgentelella/static/gentelella/js/base/dateranges_gridslider.js,sha256=TGR9Ko9MZVZGhPhe3ubvzMZcEWrlBLH2SA3E239LRyI,5571
|
|
137
137
|
djgentelella/static/gentelella/js/base/editorTinymce.js,sha256=2fT36ECHyQKLP0X74zYsSHZZ0Rqg-UywDMbG5LjJVac,1118
|
|
138
138
|
djgentelella/static/gentelella/js/base/fileupload.widget.js,sha256=MIniB9KLE8ozKuDqy5EovrZBbscqEYPMsS70ecgNB1w,10653
|
|
139
|
-
djgentelella/static/gentelella/js/base/form.common.js,sha256=
|
|
140
|
-
djgentelella/static/gentelella/js/base/formset.js,sha256=
|
|
139
|
+
djgentelella/static/gentelella/js/base/form.common.js,sha256=obPt6TS2Q-IgmnNUJeq6_FnDfLnv1ge5DprAj7_KS7Q,9199
|
|
140
|
+
djgentelella/static/gentelella/js/base/formset.js,sha256=FLgkWI3nhyIuSc22tiwyIDfwCkoILlU2zU34_-ohMmo,8430
|
|
141
141
|
djgentelella/static/gentelella/js/base/gigapixel_storymap.js,sha256=UaBtuOzHMaYeR-BabvrYiGyvvO2P1Yxykaa0vVYWKIg,627
|
|
142
142
|
djgentelella/static/gentelella/js/base/helper_widget.js,sha256=llwsuolL8zyr9GES0cpz3RHX--WXacmRNwS2Ccb3PO8,10836
|
|
143
143
|
djgentelella/static/gentelella/js/base/mapbased_storymap.js,sha256=i4Ef8ATjzpyNPSO5wSdDA0FHwc5qXqa2kZzTBWH9mY0,542
|
|
@@ -833,7 +833,7 @@ djgentelella/templates/gentelella/app/top_navigation.html,sha256=_wYOCP8bqNLybIf
|
|
|
833
833
|
djgentelella/templates/gentelella/blocks/box.html,sha256=hCZW3dl7XaiL0m--bymDQuGNDgHARdFSeQjMnHAgEx0,1229
|
|
834
834
|
djgentelella/templates/gentelella/blocks/crud_list.html,sha256=XEsr4GrGmWm-mK1kwjEvd9lSxvAVok6949srm2bn0B0,1497
|
|
835
835
|
djgentelella/templates/gentelella/blocks/helper_prototype.html,sha256=f2_Ggbv6rDhczH-4ouzbCgi_AKeHPmztKUsIEWqDCTo,312
|
|
836
|
-
djgentelella/templates/gentelella/blocks/listcard_template.html,sha256=
|
|
836
|
+
djgentelella/templates/gentelella/blocks/listcard_template.html,sha256=axMVVm5Tlv3XWHU6Vtvcj-nZkcGXJ7DL8MbVv9YTWgE,1971
|
|
837
837
|
djgentelella/templates/gentelella/blocks/modal_template.html,sha256=s1aV56Hv8kjdAZm8o0hj2g2KuuWewVBuphiUizVTofw,1026
|
|
838
838
|
djgentelella/templates/gentelella/blocks/modal_template_delete.html,sha256=M6V1IIyxC0RDNnpApuUKKi_aJ0BYQzDQoWwgjvwjh8Y,1107
|
|
839
839
|
djgentelella/templates/gentelella/blocks/modal_template_detail.html,sha256=EiYCTq9h76HaQM_xTuJHIQITVN3VQVAJ7_LUOWktM_I,696
|
|
@@ -958,17 +958,17 @@ djgentelella/templatetags/gtsettings.py,sha256=I-Eje-kzBbDYwgfawDbKPhcaxz0zoZkLj
|
|
|
958
958
|
djgentelella/templatetags/timejs.py,sha256=fmiA8FEoBr-EYnO6tji6tKBmA39g3HtX7oaU7kQ4524,476
|
|
959
959
|
djgentelella/templatetags/tree_tags.py,sha256=IOMcdXaX3IBAawoGoteRYqF5Y2ggxsLweR5XZqxfpMk,59
|
|
960
960
|
djgentelella/templatetags/urlname_tags.py,sha256=2IjabanvTSHreasTyhOEiuwFecHb_SnCdSIjdSxQJLw,1945
|
|
961
|
-
djgentelella/tests/Calendar_Test.py,sha256=
|
|
962
|
-
djgentelella/tests/Notification_Test.py,sha256=
|
|
961
|
+
djgentelella/tests/Calendar_Test.py,sha256=unFWritybgNmYjEGCct1cS2meZOFGHcA-od17XCoqrc,5216
|
|
962
|
+
djgentelella/tests/Notification_Test.py,sha256=KzPvbCXGTwdF5jJ2AE86U9ZquhIArM65jjhdLMV4MFQ,18903
|
|
963
963
|
djgentelella/tests/StoryLine_Test.py,sha256=fU90zCc0HWIe7YTlHqRfYC-uIFp7qFpege5eVc2kQtY,8523
|
|
964
964
|
djgentelella/tests/StoryMap_Test.py,sha256=wgiBpAMTFdPTQs2JqlJIBnmzbBFIlSX7_HmHIfIc-Rg,4031
|
|
965
965
|
djgentelella/tests/TimeLine_Test.py,sha256=ddaX3b9KA9LYiu81tC2-oVJFmj3RU0pr2-r4mNCyRF8,3540
|
|
966
966
|
djgentelella/tests/__init__.py,sha256=lXLNR411GFWMcJbr-ywL3OW470PLL740Q0RM29zZoqM,178
|
|
967
967
|
djgentelella/tests/fields/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
968
|
-
djgentelella/tests/fields/files.py,sha256=
|
|
968
|
+
djgentelella/tests/fields/files.py,sha256=s8efFF2xjmyAO34GRntnOkjHPwPu7dwM8Pm2WMRjKrc,1193
|
|
969
969
|
djgentelella/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
970
970
|
djgentelella/views/auth.py,sha256=ipr8O1a4dsqgVSBASAKw9FYpk5E5gDBjkzknkFnDRaY,308
|
|
971
|
-
djgentelella/views/listAreaViewset.py,sha256=
|
|
971
|
+
djgentelella/views/listAreaViewset.py,sha256=rMjp7OKxTlIXF1vFBeO3_53Hli8UKzoutk5Ohccoy_o,3273
|
|
972
972
|
djgentelella/views/select2autocomplete.py,sha256=97OTvaIL-dxH9QIQuEVUD0SF-2neAOaL1iqMDlDCnt8,4771
|
|
973
973
|
djgentelella/views/storyline.py,sha256=lGtgGnNf2-rkdh-VHUZBBNTwmg7fxOU0E3ZVLAvwHLM,2793
|
|
974
974
|
djgentelella/views/storymap.py,sha256=Y4f7-j5Izsq3ldEBEt3WkmDy_Uh5ENYJU9H0VIfol98,1025
|
|
@@ -990,9 +990,9 @@ djgentelella/widgets/trees.py,sha256=bV6s-w1cgYahS0aNU6xBrx-aISdlzDZ23BFt3_3hAu4
|
|
|
990
990
|
djgentelella/widgets/wysiwyg.py,sha256=wHeMyYNVE8-lKJ06A-0DLDAcRNv3TOAOG_Wl9DYZqS0,609
|
|
991
991
|
djgentelella/wysiwyg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
992
992
|
djgentelella/wysiwyg/views.py,sha256=tI7LjLhCnohdvIEOEEhB2Cu1zxRmdcOhYJJX4LBIZaA,1159
|
|
993
|
-
djgentelella-0.3.
|
|
994
|
-
djgentelella-0.3.
|
|
995
|
-
djgentelella-0.3.
|
|
996
|
-
djgentelella-0.3.
|
|
997
|
-
djgentelella-0.3.
|
|
998
|
-
djgentelella-0.3.
|
|
993
|
+
djgentelella-0.3.27.dist-info/AUTHORS,sha256=HyQoO-q7oXtavpNm7jaBVv8Vxx3c7yo33xkFkt4blkY,118
|
|
994
|
+
djgentelella-0.3.27.dist-info/LICENSE.txt,sha256=wDzqAntLQORAL6vQhVdzZyfsPVvFStZKtkct5DIZjK0,18047
|
|
995
|
+
djgentelella-0.3.27.dist-info/METADATA,sha256=4Xf9XbSM7NHNSrl9q90GQcpjTUV-294wxi22Q0dcylM,27575
|
|
996
|
+
djgentelella-0.3.27.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
997
|
+
djgentelella-0.3.27.dist-info/top_level.txt,sha256=88JbODVPV-P5q7ic25yMHt_FuuizaLzMyIaegpFa7Qk,13
|
|
998
|
+
djgentelella-0.3.27.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|