djangosnippets.org: Latest snippets posted by brunohttps://djangosnippets.org/users/bruno/2009-03-14T23:48:06.147986-05:00brunoJSON Encoder for models
2009-03-14T23:48:06.147986-05:00brunohttps://djangosnippets.org/snippets/1374/<p>A simplejson encoder that knows how to encode django models, and it's little brother that also know how to deals with lazy translations.</p>
Freely redistributablekeywords arguments parser for custom template tags
2009-01-21T06:41:18.562617-06:00brunohttps://djangosnippets.org/snippets/1293/<p>returns a list of (argname, value) tuples
(NB: keeps ordering and is easily turned into a dict).</p>
<p>Params:</p>
<ul>
<li>tagname : the name of calling tag (for error messages)</li>
<li>bits : sequence of tokens to parse as kw args</li>
<li>args_spec : (optional) dict of argname=>validator for kwargs, cf below</li>
<li>restrict : …</li></ul>
Freely redistributable