I'm trying to figure out how to handle this situation in which my user class (which extends AbstractUser) contains a foreign key to another object. For example,
Class Store(models.Model):
#attributes
Class Employee(AbstractUser):
store = models.ForeignKey('Store')
#other attributes
When I run syncdb, I get the error:
django.db.utils.IntegrityError: (1048, "Column 'store_id' cannot be null")
I believe I'm getting this error because it's trying to create a superuser in the syncdb script that is also an employee, and the employee/superuser can't have a null store_id.
If that's true, how does one go about changing this so that either 1) the superuser isn't an "employee", or 2) I can still create a superuser employee without this error? Thanks in advance.
Edit: I would also like to maintain the fact that every employee must have a store, and avoid setting null=true & blank=true in the model definition.