Posted on August 27th, 2011 by Chris
After running Django unittests, it may sometimes be useful to manually inspect the test database after unittests are complete. I was working on a complicated network model, trying to resolve an elusive bug in a unittest, and in this specific instance, I thought running a manually written SQL query would be a bit more helpful [...]
No Comments »
Filed under: Django, Python, Uncategorized
Posted on May 19th, 2011 by Chris
Django has a great auto-generated administration interface. It’s saved me countless hours of development time and makes basic data maintenance a breeze. Although it’s designed to be extensible, it’s not without it’s quirks and hurtles. Fortunately, most of these can be overcome with a little code inspection. One of these quirks is the superficial inability [...]
No Comments »
Filed under: Django, Python
Posted on September 18th, 2009 by Chris
I have some basic Django code that attempts to insert a new record into a PostgreSQL database. It’s wrapped in a try/except statement in case a unique constraint is violated, in which case I’ll typically ignore it and move on.
So the general pattern is:
from django.db import IntegrityError
import models
try:
myNewRecord = models.MyTable(data=blah)
[...]
8 Comments »
Filed under: Django, MySQL, PostgreSQL
Posted on September 16th, 2008 by Chris
The Idea
I had an idea to make a personalized news feed reader. Basically, I’d register a bunch of feeds with the application, and rate a few stories as either “good” or “bad”. The application would then use my ratings and the article text to generate a statistical model, apply that model to future articles, and [...]
6 Comments »
Filed under: Django, Python