tools¶
Utility-functions used by some of the other apps.
-
exception
nano.tools.
SiteProfileNotAvailable
¶
-
nano.tools.
asciify
(string)¶ Convert unicode string to ascii, normalizing with NFKD
Strips away all non-ascii symbols
-
nano.tools.
grouper
(n, iterable, fillvalue=None)¶ grouper(3, ‘ABCDEFG’, ‘x’) –> ABC DEF Gxx
Template tags¶
Either import the tags into some other templatetags-library. or add
'nano.tools'
to INSTALLED_APPS
.
Turn current url path into a query-part for use in urls
With default template:
If the path is stored in the context as /foo/bar, tag returns ‘?next=/foo/bar’
Usage {% if value|endswith:”arg” %}
Get fractional part of float, pad with zeroes until <arg> length
Get integer-part of float
Replace whitespace with non-breaking-space
Split an iterable into columns
Usage {% if value|startswith:”arg” %}