plain 0.41.0__py3-none-any.whl → 0.42.0__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.
- plain/templates/jinja/filters.py +2 -0
- plain/urls/patterns.py +1 -33
- {plain-0.41.0.dist-info → plain-0.42.0.dist-info}/METADATA +1 -1
- {plain-0.41.0.dist-info → plain-0.42.0.dist-info}/RECORD +7 -7
- {plain-0.41.0.dist-info → plain-0.42.0.dist-info}/WHEEL +0 -0
- {plain-0.41.0.dist-info → plain-0.42.0.dist-info}/entry_points.txt +0 -0
- {plain-0.41.0.dist-info → plain-0.42.0.dist-info}/licenses/LICENSE +0 -0
plain/templates/jinja/filters.py
CHANGED
@@ -19,6 +19,8 @@ default_filters = {
|
|
19
19
|
# The standard Python ones
|
20
20
|
"strftime": datetime.datetime.strftime,
|
21
21
|
"strptime": datetime.datetime.strptime,
|
22
|
+
"fromtimestamp": datetime.datetime.fromtimestamp,
|
23
|
+
"fromisoformat": datetime.datetime.fromisoformat,
|
22
24
|
# To convert to user time zone
|
23
25
|
"localtime": localtime_filter,
|
24
26
|
"timeuntil": timeuntil,
|
plain/urls/patterns.py
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
-
import functools
|
2
|
-
import inspect
|
3
1
|
import re
|
4
2
|
import string
|
5
3
|
|
6
4
|
from plain.exceptions import ImproperlyConfigured
|
7
5
|
from plain.internal import internalcode
|
8
|
-
from plain.preflight import
|
6
|
+
from plain.preflight import Warning
|
9
7
|
from plain.runtime import settings
|
10
|
-
from plain.utils.functional import cached_property
|
11
8
|
from plain.utils.regex_helper import _lazy_re_compile
|
12
9
|
|
13
10
|
from .converters import get_converter
|
@@ -226,20 +223,6 @@ class URLPattern:
|
|
226
223
|
else:
|
227
224
|
return []
|
228
225
|
|
229
|
-
def _check_view(self):
|
230
|
-
from plain.views import View
|
231
|
-
|
232
|
-
view = self.view
|
233
|
-
if inspect.isclass(view) and issubclass(view, View):
|
234
|
-
return [
|
235
|
-
Error(
|
236
|
-
f"Your URL pattern {self.pattern.describe()} has an invalid view, pass {view.__name__}.as_view() "
|
237
|
-
f"instead of {view.__name__}.",
|
238
|
-
id="urls.E009",
|
239
|
-
)
|
240
|
-
]
|
241
|
-
return []
|
242
|
-
|
243
226
|
def resolve(self, path):
|
244
227
|
match = self.pattern.match(path)
|
245
228
|
if match:
|
@@ -253,18 +236,3 @@ class URLPattern:
|
|
253
236
|
url_name=self.pattern.name,
|
254
237
|
route=str(self.pattern),
|
255
238
|
)
|
256
|
-
|
257
|
-
@cached_property
|
258
|
-
def lookup_str(self):
|
259
|
-
"""
|
260
|
-
A string that identifies the view (e.g. 'path.to.view_function' or
|
261
|
-
'path.to.ClassBasedView').
|
262
|
-
"""
|
263
|
-
view = self.view
|
264
|
-
if isinstance(view, functools.partial):
|
265
|
-
view = view.func
|
266
|
-
if hasattr(view, "view_class"):
|
267
|
-
view = view.view_class
|
268
|
-
elif not hasattr(view, "__name__"):
|
269
|
-
return view.__module__ + "." + view.__class__.__name__
|
270
|
-
return view.__module__ + "." + view.__qualname__
|
@@ -96,7 +96,7 @@ plain/templates/core.py,sha256=iw58EAmyyv8N5HDA-Sq4-fLgz_qx8v8WJfurgR116jw,625
|
|
96
96
|
plain/templates/jinja/__init__.py,sha256=qBESSL8XfwdxtwujjR5mZvk4VddlMn1-jOsSxGQy0oE,2768
|
97
97
|
plain/templates/jinja/environments.py,sha256=9plifzvQj--aTN1cCpJ2WdzQxZJpzB8S_4hghgQRQT0,2064
|
98
98
|
plain/templates/jinja/extensions.py,sha256=AEmmmHDbdRW8fhjYDzq9eSSNbp9WHsXenD8tPthjc0s,1351
|
99
|
-
plain/templates/jinja/filters.py,sha256=
|
99
|
+
plain/templates/jinja/filters.py,sha256=t_u8BkWtEpJFLbLywONxWKrenSzOvDJhfOLwlZiXHDU,968
|
100
100
|
plain/templates/jinja/globals.py,sha256=VMpuMZvwWOmb5MbzKK-ox-QEX_WSsXFxq0mm8biJgaU,558
|
101
101
|
plain/test/README.md,sha256=fv4YzziU2QxgcNHSgv7aDUO45sDOofVuCNrV1NPbWzo,1106
|
102
102
|
plain/test/__init__.py,sha256=MhNHtp7MYBl9kq-pMRGY11kJ6kU1I6vOkjNkit1TYRg,94
|
@@ -107,7 +107,7 @@ plain/urls/README.md,sha256=ijFGmrkUY9buBqO_i1GZaN3V55vl9xwEADtHOx_ZHPY,3724
|
|
107
107
|
plain/urls/__init__.py,sha256=DFO2OL1IllHW5USPIb5uYvvzf_G-Bl0Qu1zrRLHmWyM,542
|
108
108
|
plain/urls/converters.py,sha256=s2JZVOdzZC16lgobsI93hygcdH5L0Kj4742WEkXsVcs,1193
|
109
109
|
plain/urls/exceptions.py,sha256=q4iPh3Aa-zHbA-tw8v6WyX1J1n5WdAady2xvxFuyXB0,114
|
110
|
-
plain/urls/patterns.py,sha256=
|
110
|
+
plain/urls/patterns.py,sha256=7DxL5LWq40lI4hFxAJ2I4MyA3HrbCmNx_dHOk8yYiK8,8259
|
111
111
|
plain/urls/resolvers.py,sha256=3I10pLpLvhL4NamABJGH8e5Se6Iqa2y7V6hMAFQxVSg,13264
|
112
112
|
plain/urls/routers.py,sha256=iEsQtTpPNDDVn7r_BQX84FESGSjOeD5qgyO_ep5rzaU,2819
|
113
113
|
plain/urls/utils.py,sha256=WiGq6hHI-5DLFOxCQTAZ2qm0J-UdGosLcjuxlfK6_Tg,2137
|
@@ -146,8 +146,8 @@ plain/views/forms.py,sha256=ESZOXuo6IeYixp1RZvPb94KplkowRiwO2eGJCM6zJI0,2400
|
|
146
146
|
plain/views/objects.py,sha256=GGbcfg_9fPZ-PiaBwIHG2e__8GfWDR7JQtQ15wTyiHg,5970
|
147
147
|
plain/views/redirect.py,sha256=daq2cQIkdDF78bt43sjuZxRAyJm_t_SKw6tyPmiXPIc,1985
|
148
148
|
plain/views/templates.py,sha256=SU1fO9gVMp-gEQHYeFplxvmgeMyrLgT8MJ12WNVmQC8,2085
|
149
|
-
plain-0.
|
150
|
-
plain-0.
|
151
|
-
plain-0.
|
152
|
-
plain-0.
|
153
|
-
plain-0.
|
149
|
+
plain-0.42.0.dist-info/METADATA,sha256=C3twqGn46rZA-SF4AzmsLnQMfuq5mO-CNTmzN_vv-PQ,4297
|
150
|
+
plain-0.42.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
151
|
+
plain-0.42.0.dist-info/entry_points.txt,sha256=1Ys2lsSeMepD1vz8RSrJopna0RQfUd951vYvCRsvl6A,45
|
152
|
+
plain-0.42.0.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
|
153
|
+
plain-0.42.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|