'Returns a list of dictionary field: value objects that describe possible templates that can be used
to seed a module of this type.
Expects a class attribute template_dir_name that defines the directory
inside the \'templates\' resource directory to pull templates from'

@classmethod
def templates(cls):

    templates = []
    dirname = cls.get_template_dir()
    if (dirname is not None):
        for pkg in cls.template_packages:
            if (not resource_isdir(pkg, dirname)):
                continue
            for template_file in resource_listdir(pkg, dirname):
                if (not template_file.endswith('.yaml')):
                    log.warning('Skipping    unknown    template    file    %s', template_file)
                    continue
                template_content = resource_string(pkg, os.path.join(dirname, template_file))
                template = yaml.safe_load(template_content)
                template['template_id'] = template_file
                templates.append(template)
    return templates
