Archive for the ‘django’ Category

The Semantics of Python Import series has been important because the work I’m doing there supports work I’m doing elsewhere, namely modernizing the Hy import system to work with importlib, and then further shimming the import system to provide for heterogeneous source loaders. My showcase for all this has been Catalogia, a music collection management […]

Frequently, when dealing with remote APIs, there’s a progression of states with a definitive order and an endpoint.  Often, when comparing the existing state to the proposed state, I want to make sure state is progressing in the correct direction.  The stupid simple version of this is something like: ORDER_STATES = ( (‘PROCESSING’, _(“Processing”)), (‘APPROVED’, […]


Satchmo… arrrgh

Posted by Elf Sternberg as django

Here’s what annoys me most about Satchmo: it wasn’t written by Django developers.  Or, at the very least, it wasn’t written by Django developers who had ever bothered to read Jacobian’s Django in the Real World. I was trying today to customize the view of the Satchmo store as provided by the program.  I […]


Using django_uni_form and CSRF

Posted by Elf Sternberg as django, programming

The last update I have to django_uni_form, a rather amazing form layout handler for Django, does not understand what to do with the CSRF token. So in case you’re wondering, after you’ve created your form, you do the following in your view: form = FilmForm(initial = {‘title': ‘History is …’}) form.helper.add_input(Hidden(name = ‘csrfmiddlewaretoken’, value = […]

One of those problems routinely experienced by Django developers is “The Admin page of ten thousand users.” There are plenty of objects in our model that are owned by a specific user, and when we want to create or edit such a list, we’re frequently confronted with an unsorted, difficult-to-search <select> box with a randomized […]

I wish I’d known this a long time ago.  Django’s request object includes a dictionary of key/value pairs passed into the request via POST or GET methods.  That dictionary, however, works in a counter-intuitive fashion.  If a URL reads, then the expected content of request.GET[‘a’] would be ‘boo’, right?  And most of us who’ve […]

It drives me nuts that we in the Django community rely on Solr or Haystack to provide us with full-text search when MySQL provides a perfectly functional full-text search feature, at least at the table level and for modest projects. I understand that not every app runs on MySQL, but mine do, and I’m sure […]



Posted by Elf Sternberg as chat, django, personal

Last night at the Django meetup, we also talked about unit testing.  Someone mentioned continuous integration, and we all discussed our favorites.  At one point, the fellow at whose offices we were holding the meeting mentioned that his team used Hudson and pulled up an example on the overhead projector.  I mentioned that Hudson was […]

Hot on the heels of my last entry, the next utility is needed to extend the event object to automatically produce a URL compatible with Google Calendar’s “create an event” handler. Now, I could extend the Event application myself and add a get_google_url() method to the model, but let’s try to do this The Django […]

The Django Event Calendar is a fairly old and well-respected piece of code, useful for a variety of social networking and announcement-oriented applications.  It’s not the be-all of events calendars, but it does what it has to well enough.  I’ve used it on several projects. The ${BOSS} asked me to use it for announcing upcoming […]

Subscribe to Feed



February 2017
« Jan