def get_template(my): ''' get the template sobject ''' search_type = my.sobject.get_search_type_obj().get_base_key() key = "Template:%s" template = Container.get(key) if template != None: return template else: template = Template.get_latest(search_type) if not template: Container.put(key, "") else: Container.put(key, template) return template
def get_template(my, search_type=None): ''' get the template sobject ''' #TODO: this can be merged with get_template() in flash.py if not search_type: search_type = my.TMPL_SEARCH_TYPE key = "Template:%s" template = Container.get(key) if template != None: return template else: template = Template.get_latest(search_type) if not template: Container.put(key, "") else: Container.put(key, template) return template