In this:
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 is obviously incorrrect. However, in this:
class Administrator(User):
account = models.ForeignKey(Account)
class Meta:
unique_together = (('account', 'username'),)
would that work since I'm inheriting from User? (I can't test it yet because there are too many elements out of place elsewhere). Can I use the first version with 'user.username'
instead though? Or, should I use the second version?