September 3, 2010

Django Formatter Mixin Class

GuitarI’ve always disliked having to write __repr__ methods for my classes. It isn’t hard, it is just tedious. In Django, it is especially important to make them, since the admin pages use that method when listing objects from the data model.

However, since Python allows classes to have multiple inheritance, I have long since made a helper “Mixin” class to remove most of the pain from writing my __repr__ methods. If you haven’t heard the term, a “Mixin” is a class which adds functionality to classes which inherit from it. The philosophy is that it shouldn’t change base functionality, thus avoiding many of the problems with multiple inheritance.

Philosophy aside, mixins can be extremely useful, and I love this one. [Read more...]

The Coder Attitude From Both Sides

Seeing with a different pair of glassesI’ve been living a split life for six months now.

At my day-job, I am a manager. I have to track schedules, work with programmers, plan, cajole outside vendors, project future usage, and defend project priorities. It is new for me, at least as a full-time thing, and I enjoy it. From the reactions of upper management, I am pretty good at it as well.

On the side, I develop websites for clients. I don’t usually run the project management portion of this, preferring to simply program, working closely with my partners & clients.

A unique position for me

This is a unique position for me because as a rule, I have not been able to both manage and program. The mindsets are too different. [Read more...]

Simple, degradable Flash embedding using jQuery

FlashNow that I am doing professional web layouts for clients, I find myself appreciating the quick, easy, and well-documented jQuery library. I just don’t have time to hassle with Dojo and its size, widgets I don’t need, and messy documentation.

Recently for one client I needed to use a flash sidebar. The image was a slowly rotating, “fanned picture” slideshow provided by my designer partner. This would be OK, except I really dislike all the tag soup of object embedding, especially on dozens of pages. Also, I wanted to make sure that the site wouldn’t look strange with Flash turned off. In that case, I wanted to use a simple freezeframe of the first slide from the image set.

[Read more...]