djangosnippets.org: Latest snippets posted by robhudsonhttps://djangosnippets.org/users/robhudson/2009-12-09T13:47:11.089336-06:00robhudsonRemember path decorator
2009-12-09T13:47:11.089336-06:00robhudsonhttps://djangosnippets.org/snippets/1832/<p>Decorator that stores the <code>request.path</code> URL in a session variable to be used later, e.g. in a "Continue Shopping" link on a cart page. Wrap and view that you want to be able to link back to easily. When those views are called, it updates the session with the current …</p>
Freely redistributableparse date template tag
2009-10-13T13:17:21.332095-05:00robhudsonhttps://djangosnippets.org/snippets/1757/<p>Return a datetime corresponding to date_string, parsed according to format.</p>
<p>I had the need for such a thing while working with an API that returned JSON that I fed, via simplejson, directly to a template, and didn't want to change the data structure just for this one piece.</p>
Freely redistributableUse MEDIA_URL in flatpages
2008-03-22T11:02:53.941673-05:00robhudsonhttps://djangosnippets.org/snippets/654/<p>This is a template filter to enable the use of the MEDIA_URL setting in content from the flatpages database table. It searches for {{ MEDIA_URL }} and replaces it with that found in your settings.</p>
<p>Note: To set up, drop the above code into a file called <code>media_url.py</code> in your …</p>
Freely redistributableHTML Widgets
2008-02-26T16:03:00.447519-06:00robhudsonhttps://djangosnippets.org/snippets/618/<p>A simple widget library to provide HTML4 widgets for HTML validation fanatics.</p>
Freely redistributable