I've attempted to add a second ForeignKey relationship to a Django Model which relates to a model which hasn't yet been created.
class Forms2012(models.Model):
"""
Employer forms for the 2012-13 tax year
"""
employer = models.ForeignKey('Employer', blank=True, null=True)
# employee model is yet to be implemented
employee = models.ForeignKey('Employee', blank=True, null=True)
name = models.CharField(
max_length=50,
choices=constants.FORM_CHOICES)
description = models.CharField(max_length=255)
datemodified = models.DateTimeField()
As you might expect this is giving a not installed or is abstract
error. However I've been told it should be possible to validate this because that key is optional.
Could someone explain if this is possible, I've added the flags blank=True, null=True
to the FK but model validation fails so I think I'm fighting a losing battle.