Django: Beyond the SQL
Jerry Stratton
January 21, 2010
- Installation
- Installation in Django: Beyond the SQL
- Create your models
- http://docs.djangoproject.com/en/dev/topics/db/models/
- Create your administration models
- http://docs.djangoproject.com/en/dev/ref/contrib/admin/
- Public pages
- Public pages in Django: Beyond the SQL
- Customization
- Remember that you can add any method to your models, and use that method in your templates. If you have a method on the Post class called “otherAuthorPosts” that returns all of the other posts by this posting’s author, you can reference it as “post.otherAuthorPosts”. You can also provide any variable—including classes, lists, and dictionaries—to the context that your view creates, and pass it to your…
- Beyond the SQL: Cacheing
- http://docs.djangoproject.com/en/1.0/topics/cache/
- Modifying models
- Django’s syncdb command only creates new models. It doesn’t update existing models. If you make a change to your model in models.py, you will also need to make a corresponding change to the database table for that model.
- Scripting Django
- Django’s amazing API is useful for all sorts of tasks, not just web tasks. Any command-line script that deals with a database can take advantage of Django, and often your web databases have command-line scripts that work with them.
- Monolithic HTML version
- HTML version of Django: Beyond the SQL
- Monolithic PDF version
- PDF version of Django: Beyond the SQL
- Monolithic RTF version
- RTF version of Django: Beyond the SQL
- ZIP Resources for Django: Beyond the SQL
- Resources for Django: Beyond the SQL, including samples and document graphics.
- Reusing Django’s filter_horizontal
-
Just as with pop-ups, it’s possible to use the built-in JavaScript for filtering multiple-selection popups on custom forms.
- Django formsets and date/time fields
-
Date/Time fields in Django formsets appear to have incompatible default values, resulting in forms using them always looking as though they’ve got a new entry when they don’t.
- Multiple Input Fields with multiple inheritance
-
We needed to display one TextField as either a TextInput or a Textarea, depending on the value in the field. Multiple inheritance makes it easy, if a bit wonky.
- Django tutorial mostly ready
-
My long-promised Django tutorial is pretty much ready. It’s still designed around an in-person tutorial, but you should be able to get started using it even if you’re on your own.
- Django actions as their own intermediate page
-
The Django documentation recommends a complicated URL redirect to handle admin actions that need an intermediate page. But there’s no reason we can’t just piggy-back the intermediate page on the action itself.
- 22 more pages with the topic Django, and other related pages