I am taking a Django course on Udemy and have decided to add on to what I've learned by changing the layout of a form with an If statement.
Basically, I want to see if the BooleanField for the variable for_you is set to true (or if the check box in the GUI is checked), but I am having trouble figuring out how to access if the boolean field is set to false. Can anyone point me in the right direction?
class SignUp(models.Model):
for_you = models.BooleanField(default=True, verbose_name="Is this purchase for you? If so, check this box.")
if for_you:
if for_you == Trueorif for_you == False. Of course, if you want to keep the coding style that you have:if for_you:orif not for_youif is_for_you:.