breadcrumbs
With this script you can create a simple breadcrumbs line for navigation: Home >> Page >> Subpage ...
- breadcrumbs
With this script you can create a simple breadcrumbs line for navigation: Home >> Page >> Subpage ...
This subclass of django.models.Field stores a python datetime.timedelta object as an integer column in the database. It includes a TimedeltaFormField for editing it through djangos admin interface. Feedback welcome. 2011-04-20: TimedeltaField can now be (de)serialized. Tested with JSON. 2009-11-23: `_has_changed()` added. Before form.changed_data contained timedelta FormFields, even if nothing changed.
This is based on [Snippet 161](/snippets/161/) It marks duplicated SQL queries. To avoid duplicates read: [Caching and Queryset](http://www.djangoproject.com/documentation/db-api/#caching-and-querysets) Sept. 07: Updated for current trunk: 'response' behaves like 'response.header' 22. October '07: Log into directory.
See docstring
This is deprecated. I don't use it anymore, since forms now have the attribute "has_changed". The method form_changed() returns a boolean value. It is True if the submitted values of the bound and valid form are different than the initial values. It works for me. Feedback welcome. Set debug=True if you want to know what's going on.
This recipe raises an exception if there is an invalid variable in the template. See [#6766](http://code.djangoproject.com/ticket/6766) Note: I don't need this snippet any more, since I don't use the template language any more. For my projects using only python is better (complex logic, simple layout).
This django.db.models.Field stores a list of python strings in one database column.
DEPRECATED: Django has cookie based messages since version 1.2 This messages stores messages for the user in a cookie. I prefer this to session based messages, because the session column is a hot spot in the database if one user works with several browser tabs/windows.
See docstring
If you want to modify the length of a column of a contrib application, you can either modify django (cumbersome) or you can run a post_syncdb signal hook. Related: [Ticket 4748](http://code.djangoproject.com/ticket/4748)
Since the decorators of your views are evaluated during parsing urls.py you have an 'chicken - egg' problem. The method reverse() can't be used since urls.py is not read. This snippets evaluates reverse() lazy. [Related ticket: 5925](http://code.djangoproject.com/ticket/5925) Django 1.4 (current trunk) has a lazy reverse.
Deprecated. I don't use this any more. Hi, I want decimal input which uses a comma as decimal seperator. It was quite complicated, but it works. It can be used as an example how to create an own subclass of an existing db.Field class and how to pass the dbfield to the widget, and use it in its render() method. I think my snippet is too complicated, but couldn't find a better solution. If you do, please tell me.
Management command to update a primary key and update all child-tables with a foreign key to this table.
Deprecated! I use south in all applications with database backend now.
I think this method is handy, since you don't need to remember if you need urlquote or urlencode. It does both and adds a question mark between the path and the get parameters, if later are present. And it works around a bug in Django: MultiValueDicts (request.GET, request.POST) are handled correctly. Related: [http://code.djangoproject.com/ticket/9089](http://code.djangoproject.com/ticket/9089)