Tag Archives: django

Multi-dimensional dicts in Python & Django?

The code I’m working on frequently uses multi-dimensional dicts in Python.  There is a bunch of code that seems to be always doing this: # a,b, and c have come from some external data source, QuerySet, etc. a = ‘axis_1′ … Continue reading

Posted in General | Tagged , , , , | 5 Comments

Announcing Parents Guild

Just a quick note to my readers and searchers that we’ve launched our new parenting website, Parents Guild.  We’ve got question & answering, e-mail notifications, tagging, voting, and a bunch of other parenting-specific features in the works.  We’ve got about … Continue reading

Posted in General | Tagged , , , , | Leave a comment

Resolving circular model imports caused by Haystack & Django

So, in converting our search to Haystack, I’ve found that some of my standalone maintainence scripts no longer work.  They had an import error trying to import some of the models. The issue is that I’ve updated my models.py with … Continue reading

Posted in General | Tagged , , , | Leave a comment

pprinting the Django context object

This was non-obvious to me for quite some time, and I tried several different approaches before settling on this one: If you would like to pprint your Django Context (or RequestContext) object from within a template itself, there are several … Continue reading

Posted in General | Tagged , , , | Leave a comment

How to split views.py into a directory (Django, Python)

So, I’ve been doing some Django programming on the side, and the thing that annoys me is that Django forces you to put nearly all your source code into 2 files:  models.py and views.py Being a reasonable person, I wanted … Continue reading

Posted in General | Tagged , , , | 2 Comments