djgentelella 0.4.0__py3-none-any.whl → 0.4.2__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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = '0.4.0'
1
+ __version__ = '0.4.2'
2
2
 
3
3
  if __name__ == '__main__':
4
4
  print(__version__)
@@ -70,8 +70,19 @@ class DigitalSignatureRenderFileAPIView(APIView):
70
70
  return Response(file_data, content_type='application/pdf')
71
71
 
72
72
  def get_instance_file(self, instance, fieldname):
73
+ # check if instance and fieldname are not None
74
+ if not instance or not fieldname:
75
+ return None
76
+
73
77
  file_path = getattr(instance, fieldname)
74
- file_data = None
75
- with open(file_path.path, 'rb') as f:
76
- file_data = f.read()
77
- return file_data
78
+ if not file_path:
79
+ return None
80
+
81
+ # check if not file
82
+ try:
83
+ with open(file_path.path, 'rb') as f:
84
+ file_data = f.read()
85
+
86
+ return file_data
87
+ except (FileNotFoundError, OSError):
88
+ return None
@@ -69,6 +69,11 @@ class GTForm(forms.Form):
69
69
  case _:
70
70
  self.renderer.form_template_name = self.template_name_horizontal
71
71
 
72
+ def get_error_for_grid(self, name):
73
+ if name in self.errors:
74
+ return self.errors[name]
75
+ return None
76
+
72
77
  @property
73
78
  def grid(self):
74
79
  """
@@ -97,10 +102,13 @@ class GTForm(forms.Form):
97
102
  row_list = []
98
103
  for field in col:
99
104
  if field in dic_fields and dic_fields[field]:
100
- row_list.append(dic_fields[field])
105
+ row_list.append(
106
+ (dic_fields[field], self.get_error_for_grid(field))
107
+ )
101
108
  else:
102
109
  if hasattr(self, field):
103
- row_list.append(getattr(self, field)())
110
+ row_list.append((getattr(self, field)(),
111
+ self.get_error_for_grid(field)))
104
112
  col_list.append(row_list)
105
113
  grid.append(col_list)
106
114
  return grid
@@ -14,12 +14,12 @@
14
14
  {% endif %}
15
15
  {% for column in form.grid %}
16
16
  <div class="row">{% for row in column %}
17
- <div class="col">{% for field in row %}
17
+ <div class="col">{% for field, errors in row %}
18
18
  <div {% with classes=field.css_classes %}{% if classes %} class="{{ classes }} asgrid gtformfield" {% else %}
19
19
  class="mb-3 asgrid gtformfield"
20
20
  {% endif %}
21
21
  {% endwith %}>
22
- {{ errors }}
22
+ {% if errors %}{{ errors }}{% endif %}
23
23
  {% if field.label %}{{ field.label_tag }}{% endif %}
24
24
  {{ field }}
25
25
  {% if field.help_text %}
@@ -21,15 +21,13 @@
21
21
 
22
22
  {{ field }}
23
23
  {% if field.help_text %}
24
- {% if forloop.last %}
25
- {% for field in hidden_fields %}{{ field }}{% endfor %}
26
- {% endif %}
27
-
28
24
  <div class="feedback text-info" {% if field.auto_id %} id="{{ field.auto_id }}_helptext" {% endif %}>
29
25
  {{ field.help_text|safe }}
30
26
  </div>
31
27
  {% endif %}
32
-
28
+ {% if forloop.last %}
29
+ {% for field in hidden_fields %}{{ field }}{% endfor %}
30
+ {% endif %}
33
31
  </div>
34
32
  {% endfor %}
35
33
  {% if not fields and not errors %}
@@ -0,0 +1,24 @@
1
+ {% extends 'gentelella/base.html' %}
2
+ {% load i18n %}
3
+
4
+ {% block body_class %}login{% endblock body_class %}
5
+ {% block body %}
6
+
7
+ <div class="main_container">
8
+
9
+ <div class="col-md-8 offset-md-2">
10
+ <div class="col-middle">
11
+ <div class="text-center ">
12
+ <h1>{% trans 'Password changed' %}</h1>
13
+ <p>{% trans "You updated correctly your password please login again." %}</p>
14
+ <br>
15
+ <a href="/"> {% trans 'Go to home' %}</a>
16
+ {% include 'gentelella/registration/footer.html' %}
17
+
18
+
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+
24
+ {% endblock %}
djgentelella/urls.py CHANGED
@@ -45,7 +45,7 @@ auth_urls = [
45
45
  template_name='gentelella/registration/password_reset_confirm.html'
46
46
  ), name='password_reset_confirm'),
47
47
  path('accounts/reset/done/', auth_views.PasswordResetDoneView.as_view(
48
- template_name='gentelella/registration/password_reset_done.html'
48
+ template_name='gentelella/registration/reset_done.html'
49
49
  ), name="password_reset_complete")
50
50
  ]
51
51
  wysiwyg_urls = [
@@ -55,6 +55,7 @@ wysiwyg_urls = [
55
55
  name="tinymce_upload_video"),
56
56
  ]
57
57
 
58
+
58
59
  def import_module_app_gt(app, name):
59
60
  try:
60
61
  __import__(app + '.' + name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: djgentelella
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Help building extra widgets for forms and speciall methods to render forms in templates
5
5
  Author-email: Solvosoft <info@solvosoft.com>
6
6
  Maintainer-email: Luis Zarate Montero <luis.zarate@solvosoft.com>
@@ -1,4 +1,4 @@
1
- djgentelella/__init__.py,sha256=H-nNFs8-DDdkfCWjkaeYPTpU8LdYWI0G_l1PyRXmCuc,73
1
+ djgentelella/__init__.py,sha256=HE_MExHBudti_JND0IRj20MdymtZ69yjO1WihyCFMW4,73
2
2
  djgentelella/admin.py,sha256=hFPWtRyTZWYtuKEv-SZ3r6lHw3aissX0ObqxYmxblY0,1531
3
3
  djgentelella/apps.py,sha256=5VEbpUv4b1Jh7gCRAQCe5TvpakRyndKwafjVj0z-Xfo,153
4
4
  djgentelella/chartjs.py,sha256=iNYoFnaIQoXsYInJFbSE2quWpjmDz5CuMKpVsvt4pRM,8572
@@ -9,7 +9,7 @@ djgentelella/gtselects.py,sha256=f8tBg68KQoYYCW1YNZt8PiKmdjItJY2kwN23ScO6nqM,590
9
9
  djgentelella/models.py,sha256=PZGQiIGdDxhkdXAPIXb2tgyDvnnyK6e0ePjRBRJ6Bg4,4560
10
10
  djgentelella/objectmanagement.py,sha256=y_dkSKIOfKKK9t1hZ8mwcM5RNxj0bChpKYvUn50mVzs,3121
11
11
  djgentelella/settings.py,sha256=kOuXF0T9ZIg_NqIStkiKdM-QOLrRjjfHP-AVXvSGRAM,3205
12
- djgentelella/urls.py,sha256=Klm3FaR8LSeBIpGC-EI_Drpi8unCyhXmY1eszvd6MsM,4872
12
+ djgentelella/urls.py,sha256=tmTYPnNcJkcNlAhe2mp-BcSGsRmvEJuTFFZ7a2rSp9Q,4864
13
13
  djgentelella/utils.py,sha256=Bh_-KBrrLRAK_b_CkyYm0Y0HdKyJAp2vNIwESYd3PcA,825
14
14
  djgentelella/blog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  djgentelella/blog/admin.py,sha256=ImQU7Q0SJNTigjgz1o6mizJwFEepZle5JSCBJXheLMw,29
@@ -59,7 +59,7 @@ djgentelella/firmador_digital/forms.py,sha256=NGcpQOI1eUq3An5aYLI2eFjXH28nuaqMYb
59
59
  djgentelella/firmador_digital/models.py,sha256=i6odjdzP3hvAi31gIKJq6sqYkcCWf_78igEAk4_6mw4,1035
60
60
  djgentelella/firmador_digital/signvalue_utils.py,sha256=Nh8v8AkmAjWXOP9hcc9pVNhzJZpTnHwJ1a9dnWqTWTo,1320
61
61
  djgentelella/firmador_digital/utils.py,sha256=jlJorQh8cC8iJCe5gXS3d-mR_GK8_XjaKEq4GeZ5Zbc,5354
62
- djgentelella/firmador_digital/viewsets.py,sha256=UetqF6U83OI8MCoh804GABEvzCqEs2B3uUL5uJIPFhc,3003
62
+ djgentelella/firmador_digital/viewsets.py,sha256=caxoifIMe1UHh61wmHjpRoBcyga08B8uViQgGZIVYsY,3274
63
63
  djgentelella/firmador_digital/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  djgentelella/firmador_digital/config/asgi_config.py,sha256=mGWMKpdgoqL28MTwuQTEHtf3JJYxah3-Uguddd9p3DM,1071
65
65
  djgentelella/firmador_digital/config/asgi_worker.py,sha256=r8CLU1L04hIZ2xCUb-l0jf5q2p1AMTL6z8YVEabsWTQ,188
@@ -71,7 +71,7 @@ djgentelella/firmador_digital/gunicorn/config_asgi.py,sha256=PZMb4ELq3Og_9jEET7D
71
71
  djgentelella/firmador_digital/gunicorn/config_wsgi.py,sha256=GOTN3n90aWTvjNLU_n7DOqlOZ7UH9H4vJ_4cdUM0PHE,539
72
72
  djgentelella/forms/__init__.py,sha256=tsFtaTeLH5pOQrgAVd4xjU6w3rPskn15b9kiW9GZuH8,84
73
73
  djgentelella/forms/decorators.py,sha256=MpXYM2P4lgLLoNhTVwphYHPENIipKk-qEP9MmEa-nrY,2328
74
- djgentelella/forms/forms.py,sha256=Yz5PDYQcupORRQzsJBJrGDBpTiyDK-AkjEfYHQmfW-8,7409
74
+ djgentelella/forms/forms.py,sha256=wFpNJT8GAhYDfjGZ_f_IrHRIAC9Ly1_VznDQCoDgUAg,7718
75
75
  djgentelella/forms/models.py,sha256=eZNVwPVytY0vVXUgmVWiZfZsXctFy62O1JsYyxqL4v0,389
76
76
  djgentelella/locale/es/LC_MESSAGES/django.mo,sha256=nhgNgd7-UdcF8svqO1zmH7w9PUrnVkDyOBkkTdgllrk,13845
77
77
  djgentelella/locale/es/LC_MESSAGES/django.po,sha256=el-Vh6DRjx8n0JPQe3FvvfvFiqaRdzJ23RRqKAezBNM,13705
@@ -854,9 +854,9 @@ djgentelella/templates/cruds/ajax/create.html,sha256=JkXVRcqtOReTa87VgUWEvQlETPW
854
854
  djgentelella/templates/cruds/ajax/delete.html,sha256=6rA2djOPaq6WBS-glI0verQkBEHBe-ghufXXgN5Kd80,1325
855
855
  djgentelella/templates/cruds/ajax/list.html,sha256=m-_d3qEzzyfyuecW6xaLIHHG50IemXRcqAaCjV8KmFk,3219
856
856
  djgentelella/templates/cruds/ajax/update.html,sha256=Ug6rjPH7p_ntlYzDzDnSi1h3s4F4v1hSzSHSL6OxmBw,412
857
- djgentelella/templates/forms/as_grid.html,sha256=9vIpi-pSbJZkjrm0IMr-hz-L_x_X0z8MNHq-Yj2mNBE,1225
857
+ djgentelella/templates/forms/as_grid.html,sha256=IcTELHlTZSOmIToU2qmal58Hbm5E9jlCfKXBmlpMEOA,1259
858
858
  djgentelella/templates/forms/as_horizontal.html,sha256=xJZsaWyFbDRCIIzylvbMiUC7XYucol_L020zjdh3nP0,1208
859
- djgentelella/templates/forms/as_inline.html,sha256=9vWvlc8nsIgRrrzMG_AxqpL18o0FdkTAipvZbyGrSe8,1116
859
+ djgentelella/templates/forms/as_inline.html,sha256=wrpzUKvmRx2ziiIudKVToUWJmBr8BLKOKD3bQXfQL3g,1114
860
860
  djgentelella/templates/forms/as_plain.html,sha256=dgXACGwpWDc4kVvjIu9LMTNtfqERfsNYKD7an-iezu8,1065
861
861
  djgentelella/templates/gentelella/base.html,sha256=rdiJZrrKJxMzxd4oaBTYSPXaEHdEgGOgM9Cwd7Wg8mk,2804
862
862
  djgentelella/templates/gentelella/base_site.html,sha256=nE9evkN8CAMhiRxdBOkF_t4mtonOMGlGPG9h3hCB3Xg,36
@@ -915,6 +915,7 @@ djgentelella/templates/gentelella/registration/password_reset_subject.txt,sha256
915
915
  djgentelella/templates/gentelella/registration/registration_closed.html,sha256=dMC2kjm3ozdx0jEizq8vp3oIjRH8r2xa7joCt1M-MQU,422
916
916
  djgentelella/templates/gentelella/registration/registration_complete.html,sha256=T0FiClxtCjvDEaM6eIQqHy7JHONXfqLu1uT9Zx4wqqM,433
917
917
  djgentelella/templates/gentelella/registration/registration_form.html,sha256=5B3Q1fnzIjgK-67-9VnHCntstoxDUH5t34dPJm3PiWA,525
918
+ djgentelella/templates/gentelella/registration/reset_done.html,sha256=wNphaPkA2ZcSucqtNbx-7YYfSH85yKcKeRuz7kMH0gA,536
918
919
  djgentelella/templates/gentelella/statics/javascript.html,sha256=itTGlEH5vjOWE7TfPn0tIXizYWDPNpVT3_CIzZ9fCUk,7620
919
920
  djgentelella/templates/gentelella/statics/javascript_header.html,sha256=QZ8r699zRcfFMOHLcRZXg28wnIbjkoy2ymmPo3x4gZA,1213
920
921
  djgentelella/templates/gentelella/statics/stylesheets.html,sha256=mv-qiBFy2kO7OzO7l1qqlFnXlGuMBerRtGuZ9fYIh84,3241
@@ -1029,9 +1030,9 @@ djgentelella/widgets/trees.py,sha256=bV6s-w1cgYahS0aNU6xBrx-aISdlzDZ23BFt3_3hAu4
1029
1030
  djgentelella/widgets/wysiwyg.py,sha256=wHeMyYNVE8-lKJ06A-0DLDAcRNv3TOAOG_Wl9DYZqS0,609
1030
1031
  djgentelella/wysiwyg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1031
1032
  djgentelella/wysiwyg/views.py,sha256=tI7LjLhCnohdvIEOEEhB2Cu1zxRmdcOhYJJX4LBIZaA,1159
1032
- djgentelella-0.4.0.dist-info/AUTHORS,sha256=HyQoO-q7oXtavpNm7jaBVv8Vxx3c7yo33xkFkt4blkY,118
1033
- djgentelella-0.4.0.dist-info/LICENSE.txt,sha256=wDzqAntLQORAL6vQhVdzZyfsPVvFStZKtkct5DIZjK0,18047
1034
- djgentelella-0.4.0.dist-info/METADATA,sha256=7JmjMhxcMK2xCmDdU8iz5MT_pVbO2bcaGW7EGkCUGjo,27544
1035
- djgentelella-0.4.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1036
- djgentelella-0.4.0.dist-info/top_level.txt,sha256=88JbODVPV-P5q7ic25yMHt_FuuizaLzMyIaegpFa7Qk,13
1037
- djgentelella-0.4.0.dist-info/RECORD,,
1033
+ djgentelella-0.4.2.dist-info/AUTHORS,sha256=HyQoO-q7oXtavpNm7jaBVv8Vxx3c7yo33xkFkt4blkY,118
1034
+ djgentelella-0.4.2.dist-info/LICENSE.txt,sha256=wDzqAntLQORAL6vQhVdzZyfsPVvFStZKtkct5DIZjK0,18047
1035
+ djgentelella-0.4.2.dist-info/METADATA,sha256=JSeHP7IbPfUxHX6bAHGFYadz3vD0GC5xlWnTjGW-X1Q,27544
1036
+ djgentelella-0.4.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1037
+ djgentelella-0.4.2.dist-info/top_level.txt,sha256=88JbODVPV-P5q7ic25yMHt_FuuizaLzMyIaegpFa7Qk,13
1038
+ djgentelella-0.4.2.dist-info/RECORD,,