overriding model field defaults in inherited model class with static methods

2009-06-02 Thread herr.klein...@googlemail.com
Hi. I'm trying to override the defaults of an text field in an subclass. I thought i could accomplish that by the following code, but models.TextField(default = default('flags')... wouldn't find default (). I cant reference it by self.__class__.default() as the is no self at the field initializat

Re: inheritance, abstract base classes and generic foreign keys

2009-04-10 Thread herr.klein...@googlemail.com
On Apr 10, 12:10 pm, Malcolm Tredinnick wrote: > On Fri, 2009-04-10 at 02:34 -0700, herr.klein...@googlemail.com wrote: > > Thanks Malcom. > > > All right lets see if i could put my real problem simpler. Lets say > > you are the tutor of a programming course a

Re: inheritance, abstract base classes and generic foreign keys

2009-04-10 Thread herr.klein...@googlemail.com
niel On Apr 10, 1:43 am, Malcolm Tredinnick wrote: > On Thu, 2009-04-09 at 15:48 -0700, herr.klein...@googlemail.com wrote: > > Hi! > > > I have cages filled with animals. All animals can move, but they do it > > all differently. Some animals even have attributes the oth

inheritance, abstract base classes and generic foreign keys

2009-04-09 Thread herr.klein...@googlemail.com
Hi! I have cages filled with animals. All animals can move, but they do it all differently. Some animals even have attributes the others don't. Now i want all the animals in a cage to move. How do i implement that in Django? First i thought i could use simple inheritance, serialize the attribute