South unran migration check
Middleware that checks if you ran all South migrations. If not, it will throw an exception. Make sure to only use this middleware in development!
- middleware
- migration
- south
Middleware that checks if you ran all South migrations. If not, it will throw an exception. Make sure to only use this middleware in development!
Helper functions to use the Google Visualization API in Django. Module stores queries to use and creates a JSon representation of a Google Visualization DataTable for each by inspecting the query's model. Looks up any choices defined for the columns. Depends on Google Visualization Python API: https://code.google.com/p/google-visualization-python/ To use, define the queries to use with the Visualization API at the head of views.py with: add_query(queryset, 'query name') then in view functions, get the JSon representation of a Google Visualization DataTable for the query with: my_json = get_viz_json('query name') Within the HTML template, pipe the JSon through safe: var dataTable = new google.visualization.DataTable( {{ my_json|safe }} );
Decorator to preserve view from logged users.
This is a simple logging [filter](https://docs.djangoproject.com/en/1.5/topics/logging/#topic-logging-parts-filters) to ensure that user-entered passwords aren't recorded in the log or emailed to admins as part of the request data if an error occurs during registration/login.
This is a modification of http://djangosnippets.org/snippets/1707/ that handles the database going down or PG Bouncer killing the connection. This also works in things like Twisted to make sure the connection is alive before doing a real query. Thanks @mike_tk for the original post! EDIT: Updated the wrapper to handle multi-db. Before it was using the first connection it made, now it creates an attribute name for the connection based on the name of the database.
A template filter to make proper nouns posessive. If `context_var` was 'skarphace': {{ context_var|s }} Would be: skarphace's
Modelform cant inhertit from forms. To solve this issue, split thing you wanto to inherit into filed definition and functionality definition. For modelform use the base_fields.update method as mentioned in the code.
Theses two templatetags make easy to add an active class on a navigation link. The first one is based on a regexp an search if the request path match it. The second one simply use view names.
Use this directive to show google-map if you don't want to use 'raw' directive. default location is my favorite place. Of course you can change it :)
This is a YAML version of http://djangosnippets.org/snipptes/2397
Provide additional context_data in case the submitted form is valid. This can be a message to confirm that the changes are saved.
Usage: `{%formfield form.description rows="3"%}`
Email Validation Snippet.
The version of [snippet](http://djangosnippets.org/snippets/2397/) that works with Django 1.5. Kudos to [kmike](http://djangosnippets.org/users/kmike/) for the original snippet.
An improvement to the excellent snippet by guettli [http://djangosnippets.org/snippets/2691/](http://djangosnippets.org/snippets/2691/) Added support for cascading relations when using model inheritance.
3110 snippets posted so far.