django - Python - How to access variable data that was set by methods -


i taking django course on udemy , have decided add on i've learned changing layout of form if statement.

basically, want see if booleanfield variable for_you set true (or if check box in gui checked), having trouble figuring out how access if boolean field set false. can point me in right direction?

class signup(models.model): for_you = models.booleanfield(default=true, verbose_name="is purchase you? if so, check box.") if for_you: 

i think need tell bit more context you're trying access for_you.

i'm not sure if helpful you, here's how access for_you depending on in relation signup class.

inside method of signup:

class signup(models.model):      def my_method(self):         if self.for_you:             # stuff 

outside signup:

my_sign_up = signup() if my_sign_up.for_you:     # stuff 

Comments

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

css - SVG using textPath a symbol not rendering in Firefox -

order - Notification for user in user account opencart -