I already have a model,
class ModelA( models.Model ):
name = models.CharField ( max_length = 255, blank = False )
and i have many entries in it. Now i want to add a field in it, which is
user = models.OneToOneField( User )
How do i add this field into ModelA
? Is there any solution other than deleting all previous entries?
I would use this pattern:
BTW, if you use OneToOneField() without null=True, you can set primary_key=True on this field, since it must be unique. But I don't know if south can handle this migration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With