magicrebirth


Member since 12/07/2009

17 snippets

6661 profile views

1 Comment(s) Posted

View their favorites

Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

magicrebirth's Recent Django Snippets



« Prev 1 Next »
While django provides the django_admin.py cleanup script, if sessions get out of control sometimes you have to go lower level to get everything cleaned up. If the problem gets out of hand and you hit the resource limits of the machine, it is very dif...
0 1029 posted 12 years ago by magicrebirth
Not only is it really really fast; it's also order preserving and supports an optional transform function
0 838 posted 12 years ago by magicrebirth
example: a method on a model that outputs a list of tuples with (attribute_name.verbose, attribute_value)
0 753 posted 14 years ago by magicrebirth
First: create a file under djangoapp/templatetags where you define your tags [e.g.: myadmin_tags.py]: Second: create the html snippets that get loaded in those tags [e.g., personfactoid_info.html]: Third: in mytemplates/admin/ modify change_for...
1 901 posted 14 years ago by magicrebirth
This function takes anything which can be dumped into JSON and returns an HTTP response of it, with the right Content-type header.
2 678 posted 14 years ago by magicrebirth
« Prev 1 Next »