In that:
class Administrator(models.Model): user = models.OneToOneField(User, primary_key=True) account = models.ForeignKey(Account) class Meta: unique_together = (('account', 'self.user.username'),)
The self.user.username part self.user.username clearly incorrect. However, in this:
class Administrator(User): account = models.ForeignKey(Account) class Meta: unique_together = (('account', 'username'),)
will work since i inherit from user? (I still cannot verify this because there are too many elements in this place). Can I use the first version with 'user.username' instead? Or should a second version be used?
django django-models
orokusaki
source share