djangosnippets.org: Latest snippets posted by Kronuzhttp://djangosnippets.org/users/Kronuz/2011-10-28T13:23:16.561004-05:00KronuzDjango model objects and querysets dehydration/hydration
2011-10-28T13:23:16.561004-05:00Kronuzhttp://djangosnippets.org/snippets/2584/<p>Dehydrates objects that can be dictionaries, lists or tuples containing django
model objects or django querysets. For each of those, it creates a
smaller/dehydrated version of it for saving in cache or pickling. The reverse
operation is also provided so dehydrated objects can also be re-hydrated.</p>
<p><em>Example:</em></p>
<pre><code>>>> import pickle …</code></pre>
Freely redistributableCommit on success unless managed decorator
2009-09-13T20:29:52.766355-05:00Kronuzhttp://djangosnippets.org/snippets/1725/<p>This decorator is to make it's decorated function to commit the transaction on success (rollback otherwise) unless the transactions are being already managed.</p>
Freely redistributable