I have two classes with the same set of fields. But class B should
have this set exactly two times:
class A(models.Model):
fieldA = models.IntegerField()
fieldB = models.IntegerField()
class B(models.Model):
fieldA = models.IntegerField()
fieldB = models.IntegerField()
anotherfieldA = models.IntegerField()
anotherfieldB = models.IntegerField()
I want to have something like
class Fields(models.Model):
fieldA = models.IntegerField()
fieldB = models.IntegerField()
class Meta:
abstract = True
class A(models.Model):
fields = models.ForeignKey(Fields)
class B(models.Model):
fields = models.ForeignKey(Fields)
anotherfields = models.ForeignKey(Fields)
Is there another way than an abstract class for defining a group of
fields?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---