Done, and gets things smart.
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’, [...]
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 clonesatchmo.py program. I [...]
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 = [...]
30Nov
Posted by Elf Sternberg as django
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 [...]
24Oct
Posted by Elf Sternberg as django, programming, python
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 http://foo.com?a=boo, 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 [...]
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 [...]
06Oct
Posted by Elf Sternberg as django, python, web development
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 [...]
18Aug
Posted by Elf Sternberg as django, web development
I searched for “django gearman” on Google and Bing, and found precious little. There isn’t much out there, so I’ve decided to put together my own example, using Gearman as a queue manager. If you don’t know what Gearman is, it’s a “generic application framework to farm out work to other machines or processes that [...]