Commit graph

6 commits

Author SHA1 Message Date
Kevin Morris
210e459ba9
Eradicate the dedupe_qs filter
The new `extend_query` and `urlencode` filters are way cleaner ways
to achieve what we did with `dedupe_qs`.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-08-31 14:44:29 -07:00
Kevin Morris
a114bd3e16
aurweb.util: add extend_query and to_qs helpers
The first addition, extend_query, can be used to take an existing
query parameter dictionary and inject an *additions as replacement
key/value pairs.

The second, to_qs, converts a query parameter dictionary to
a query string in the form "a=b&c=d".

These two functions simplify and make dedupe_qs and quote_plus more
efficient in terms of constructing custom query string overrides.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-08-31 13:29:06 -07:00
Kevin Morris
ac1779b705 add util.number_format -> number_format Jinja2 filter
Implement a `number_format` equivalent to PHP's version.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-26 01:11:52 -07:00
Kevin Morris
d5e650a339 add util.dedupe_qs -> dedupe_qs Jinja2 filter
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-19 09:53:59 -07:00
Kevin Morris
b1baf76998 add util.as_timezone -> as_timezone Jinja2 filter
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-19 09:53:48 -07:00
Kevin Morris
ac67268a28 add util.timezone_to_datetime -> dt Jinja2 filter
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-19 09:53:30 -07:00