djgentelella 0.3.26__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/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.26.dist-info → djgentelella-0.3.27.dist-info}/METADATA +1 -3
- {djgentelella-0.3.26.dist-info → djgentelella-0.3.27.dist-info}/RECORD +13 -13
- {djgentelella-0.3.26.dist-info → djgentelella-0.3.27.dist-info}/WHEEL +1 -1
- {djgentelella-0.3.26.dist-info → djgentelella-0.3.27.dist-info}/AUTHORS +0 -0
- {djgentelella-0.3.26.dist-info → djgentelella-0.3.27.dist-info}/LICENSE.txt +0 -0
- {djgentelella-0.3.26.dist-info → djgentelella-0.3.27.dist-info}/top_level.txt +0 -0
djgentelella/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.3.
|
|
1
|
+
__version__ = '0.3.27'
|
|
@@ -31,8 +31,8 @@ class TestEntryEditing(TestCase):
|
|
|
31
31
|
form.save()
|
|
32
32
|
|
|
33
33
|
actual = models.Entry.objects.get(pk=self.entry.pk)
|
|
34
|
-
self.
|
|
35
|
-
self.
|
|
34
|
+
self.assertEqual(actual.title, update['title'])
|
|
35
|
+
self.assertEqual(actual.content.raw, update['content'])
|
|
36
36
|
self.assertIsNotNone(actual.published_timestamp)
|
|
37
37
|
|
|
38
38
|
|
|
@@ -60,6 +60,6 @@ class TestEntryCreation(TestCase):
|
|
|
60
60
|
form.save()
|
|
61
61
|
|
|
62
62
|
actual = models.Entry.objects.get(slug='last-post-final')
|
|
63
|
-
self.
|
|
64
|
-
self.
|
|
63
|
+
self.assertEqual(actual.title, create['title'])
|
|
64
|
+
self.assertEqual(actual.content.raw, create['content'])
|
|
65
65
|
self.assertIsNone(actual.published_timestamp)
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
<div class="row container mt-3">
|
|
4
4
|
|
|
5
5
|
{% if form %}
|
|
6
|
-
<div class="col
|
|
6
|
+
<div class="col-12 {{ distribution.0 }}">
|
|
7
7
|
<form id="{{id}}_filter_form" class="row filter_form" onsubmit="return false;">
|
|
8
8
|
{{form}}
|
|
9
9
|
</form>
|
|
10
10
|
</div>
|
|
11
|
-
<div class="col
|
|
11
|
+
<div class="col-12 {{ distribution.1 }}">
|
|
12
12
|
<div class="btn-group" role="group" aria-label="search">
|
|
13
13
|
<button type="button" class="btn general_action btn-outline-primary" title="{% trans 'Search' %}"
|
|
14
14
|
data-action="search">
|
|
@@ -55,7 +55,7 @@ class CalendarWidgetTest(TestCase):
|
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
def test_widget_events(self):
|
|
58
|
-
self.
|
|
58
|
+
self.assertEqual(self.calendarWidget.widget.events, self.events)
|
|
59
59
|
|
|
60
60
|
def test_calendar_attrs(self):
|
|
61
61
|
self.assertDictEqual(self.calendarWidget.widget.calendar_attrs,
|
|
@@ -122,11 +122,11 @@ class FormCalendarWidgetTest(TestCase):
|
|
|
122
122
|
|
|
123
123
|
def test_widget_id_form(self):
|
|
124
124
|
calendar_id = self.render('{{form.calendar.id_for_label}}', {'form': self.form})
|
|
125
|
-
self.
|
|
125
|
+
self.assertEqual(calendar_id, 'id_calendar')
|
|
126
126
|
|
|
127
127
|
def test_events_src_input(self):
|
|
128
128
|
calendar_name = self.render('{{form.calendar.html_name}}', {'form': self.form})
|
|
129
|
-
self.
|
|
129
|
+
self.assertEqual(calendar_name, 'calendar')
|
|
130
130
|
|
|
131
131
|
def test_widget_name_form(self):
|
|
132
132
|
calendar_input = self.render('{{form}}', {'form': self.form})
|
|
@@ -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
|
|
@@ -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
|