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
--~--~-~--~~~---~--~~
Y
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 reverse(index,kwargs=dict(fk=se
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 subclass
3 matches
Mail list logo