Closed gelodefaultbrain closed 3 years ago
Got it! these are the functions I am referring to. Good thing you have this guys! GREAT LIBRARY THANKS!
def set_fields(self, fields):
if isinstance(fields, list):
self.fields = fields
elif isinstance(fields, str):
self.fields = yaml.full_load(fields)
def set_templates(self, templates):
if isinstance(templates, list):
self.templates = templates
elif isinstance(templates, str):
self.templates = yaml.full_load(templates)
hello! Thank you so much for this library! It has been really helpful!
I just got a question cause once you create an object of type
Model
you're going to pass infields
andtemplate
right... So in my program I'll be needing to somehow UPDATE those fields and templates depending on the Question and Answer data that I have so my question is... Is there afunction
orsetter method
that would update thefields
andtemplates
attribute in the class?I know I can make a new instance of a model over and over again but I think that's not programmatically efficient so I am asking the devs about this if they have included it... I know I can also call
dir()
to see the methods and review the code but I would like to ask it here and probably learn more about it when I talk to one of the developers.Example here: So when I create that
my_model
is there a way to update the attributes? Can I just simply do a.fields = #something
same withtemplates
? I was wondering if there could be a function for it.,Again THANK YOU FOR THIS! SUCH A HELPFUL LIBRARY!