djangosnippets.org: Latest snippets posted by rfkhttps://djangosnippets.org/users/rfk/2009-02-26T17:41:28.320005-06:00rfkNested commit_on_success
2009-02-26T17:41:28.320005-06:00rfkhttps://djangosnippets.org/snippets/1343/<p>This is a simple modification to the standard transaction.commit_on_success decorator that is aware of existing transactions. If a managed transaction is already active then the wrapped function is called directly, assuming the active transaction will clean up as appropriate. Otherwise, a standard commit_on_success is performed.</p>
<p>I'm using this to wrap …</p>
Freely redistributableFake File Uploads
2009-01-27T18:22:09.672591-06:00rfkhttps://djangosnippets.org/snippets/1300/<p>In-browser testing frameworks (I'm using <a href="http://www.getwindmill.com/">Windmill</a>) have trouble testing file uploads because javascript's security policy prevents them from setting the value of file input fields. Instead the tests must issue some sort of "fake" file upload request, but implementing this on an ad-hoc basis quickly gets ugly.
</p>
<p>This middleware …</p>
Freely redistributable