Getting all the concrete model classes inheriting from a certain abstract model class

2010-06-04 Thread Vasil Vangelovski
Hi I have around 30 models inheriting from one abstract model class and the number may grow (there's a specific reason for this design decision, involving making the database easy for people to make reports from the data with other tools, namely ms access, and making it easier to make chang

Changing arguments of field inherited from abstract model class

2010-03-01 Thread Mihail Lukin
Hi, Community I'm looking for a hack to change default value of field inherited from abstract model class. Example: class StuffBase(models.Model): access_level = models.IntegerField(default=0) class Meta: abstract = True class StuffA(StuffBase): data = models.XML

Accessing Child Meta Attributes from Abstract Model Class

2009-08-31 Thread Brett Epps
Hi, I've got an abstract base class like this: class Base(models.Model): class Meta: abstract = True def save(self, *args, **kwargs): print dir(self.Meta) super(Base, self).save(*args, **kwargs) and a child model class inheriting from it like this: class Child

abstract model class

2009-06-12 Thread Rusty Greer
i am trying to implement a save function on a model class that inherits from an abstract base class. what i am trying to do is set the field in the base class only if it isn't already set. i have the following: class Base(models.Model): attribute = models.ForeignKey('Attribute', db_index=Tru

Re: Problem with abstract model class

2008-05-16 Thread Matthias Kestenholz
On Fri, 2008-05-16 at 14:51 -0700, Legioneer wrote: > It looks that this is not the case. The problem seems to be more > general. When I add abstract=True to ANY model I receive the same > error. Example: > > class OrderItem(models.Model): > num = models.IntegerField(default=1) > timestam

Re: Problem with abstract model class

2008-05-16 Thread Legioneer
It looks that this is not the case. The problem seems to be more general. When I add abstract=True to ANY model I receive the same error. Example: class OrderItem(models.Model): num = models.IntegerField(default=1) timestamp = models.DateTimeField(auto_now=True) class Meta: a

Re: Problem with abstract model class

2008-05-16 Thread Julien
Hi, I think it should be %(class)s, not %s(class)s(take out the first 's') Julien On May 16, 11:33 pm, Legioneer <[EMAIL PROTECTED]> wrote: > Hi All, > > Got a problem when trying to define an abstract class. Below there is > an examle: > > class PaymentData(models.Model): > owner = mod

Problem with abstract model class

2008-05-16 Thread Legioneer
Hi All, Got a problem when trying to define an abstract class. Below there is an examle: class PaymentData(models.Model): owner = models.ForeignKey(Customer, related_name="%s(class)s_related" ) class Meta: abstract = True When running 'python manage.py validate' receive an erro

Abstract model class?

2007-01-30 Thread rzimerman
Is there a way to create a parent class of several model classes, but that does not itself get a db table? In other words, I want the child classes to get all of the columns of their parent class, but I don't want the parent class to be generated in the database. Thanks, Robert --~--~---