models.py
# one to one relationship means that User can only have one customer and customer can have only one User
#on_delete= models.CASCADE means we just want to delete this item if the user item is deleted
## property decorator is used to access the function as attribute not as a method
#on_delete=models.SET_NULL, here we did not use cascade becoz on using cascade that means if user is deleted than his item get also deleted
# here we use SET_NULL which means if user deleted order should not be deleted
Comments
Post a Comment