Electric Words

Dan Ellis’s technical blog

Skip to: Content | Sidebar | Footer

Date: August 7th, 2008

Parameterised classes in Python

7 August, 2008 (16:41) | python | By: dan

Recently, when working with Django, I wanted to create a class that would automatically render instances of a model as an editable HTML table. I used a Django-esque approach to defining the table columns, such that it was similar to Model and Form classes:

class ProductTable(Table): _model = Product name [...]