Welcome To Snipplr


Everyone's Recent Django Snippets Tagged django



« Prev 1 Next »
Commands to dump and load a database in django
0 3455 posted 12 years ago by erichlotto
It's imposible to read de "_id" field en django templates ( {{element._id}} === error) So, to read it, you must do a templatetag. Now you hace the templatetag, you can use it like this: {{element|pk}}
0 3446 posted 12 years ago by viroide
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 3379 posted 13 years ago by magicrebirth
0 2981 posted 14 years ago by stewartduffy
Instead of directly edit your TEMPLATE\_CONTEXT\_PROCESSORS, import it in your app's settings.py and just append what you need. (credits: denysonique and all #django channel community)
0 1244 posted 14 years ago by caruso_g
0 1303 posted 14 years ago by Affix
0 3067 posted 14 years ago by magicrebirth
Simula in Django i campi created e updated aggiornati automaticamente alla creazione e alla modifica del record (Versione 2 senza funzione save ridefinita)
0 2902 posted 14 years ago by munkypot
0 1150 posted 15 years ago by magicrebirth
0 2984 posted 15 years ago by martin_rusev
example: a method on a model that outputs a list of tuples with (attribute_name.verbose, attribute_value)
0 3008 posted 15 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 1447 posted 15 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 2908 posted 15 years ago by magicrebirth
2 1177 posted 15 years ago by vas3k
Django template system highlighting is included from Vim 7.1. You can easily turn it on with setfiletype.
0 936 posted 16 years ago by escalant3
« Prev 1 Next »