Posts

Showing posts from September, 2020

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

forms.py

 *  it includes an HTML form generation feature - basically, you use it to have Django generate forms according to the models that you’ve schemed already using the previously mentioned ORM. * 

Django - OTP