Re: problems subclassing models

2009-10-09 Thread Chris Withers
Daniel Roseman wrote: > If your base model doesn't contain any fields, you should probably > mark it as abstract. > http://docs.djangoproject.com/en/dev/topics/db/models/#id6 Thanks, knew there'd be some magic I needed to invoke ;-) Chris --~--~-~--~~~---~--~~

Re: problems subclassing models

2009-10-08 Thread Daniel Roseman
On Oct 8, 4:05 pm, Chris Withers wrote: > Hi All, > > I have a set of models that all have the same implementation for a > method, so I thought I'd create a base class for these: > > class UrlModel(models.Model): >      def get_absolute_url(self): >          return

problems subclassing models

2009-10-08 Thread Chris Withers
Hi All, I have a set of models that all have the same implementation for a method, so I thought I'd create a base class for these: class UrlModel(models.Model): def get_absolute_url(self): return reverse(index,kwargs=dict(fk=self.pk)) ...and then have the relevant models