Add HTML Attributes in Model
Maybe there is a better solution, feedback welcome!
- form_for_model
- modelform
Maybe there is a better solution, feedback welcome!
Changing the size of max_length in the model is fast. But sometimes you forget to update all running systems which use this model. This unittest helps you to find the difference between Model and DB before the users get uncaught exceptions.
If you need two values for validation, you can't use clean_value_a() since it is undefined if value_a or value_b gets cleaned first. This little helper lets you add ValidationErrors to fields instead of \__all\__. Related [Ticket 5335](http://code.djangoproject.com/ticket/5335).
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)
has_perm.py: Check if a user can access a view without calling it One of the goals: You can disable or hide a link if the user must not call it.
If you app defines some URLs with a name, and you want to overwrite this at project level with a different view you can use this snippet. You only need to change on line in the application code (the import statement).
See docstring