Django ForeignKey created empty?
- by Scott Willman
This seems very basic and I must be missing something, but here goes anyways...
With two models like so:
class School(models.Model):
name = models.CharField("Official School Name", max_length=128)
address = models.TextField("Address of the School", max_length=256)
mascot = models.CharField("Name of the School Mascot", max_length=128)
class StudentProfile(models.Model):
name = models.CharField(max_length=128)
school = models.ForeignKey(School)
If the student gets created before the school, how do I give 'school' a default empty value? Is it blank or null or what?
Thanks!