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
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
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
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
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
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
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
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
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
--~--~---
9 matches
Mail list logo