steambird/templatetags/render_template_type.py
def render_template_type(_context, obj: StudyMaterialEdition, template_path: str):
    """
    Fetches template based on the type of the material. Works based on the Polymorphic c_type

    :param _context: Context of the page it is loaded from
    :param obj: StudyMaterialEdition object. Is used to retrieve the
    :param template_path: string to the relative path to find the template which should be rendered
    :return: template which is loaded
    """

    material_object = obj.polymorphic_ctype.model

    return get_template(
        template_path.format(material_object)
    ).render({material_object: obj})

    Fetches template based on the type of the material. Works based on the Polymorphic c_type

    :param _context: Context of the page it is loaded from
    :param obj: StudyMaterialEdition object. Is used to retrieve the
    :param template_path: string to the relative path to find the template which should be rendered
    :return: template which is loaded
    
Fetches template based on the type of the material. Works based on the Polymorphic c_type
Fetches template based on the type of the material . Works based on the Polymorphic c_type
def render_template_type(_context, obj: StudyMaterialEdition, template_path: str):
    material_object = obj.polymorphic_ctype.model
    return get_template(
        template_path.format(material_object)
    ).render({material_object: obj})
def render_template_type ( _context , obj : StudyMaterialEdition , template_path : str ) : material_object = obj . polymorphic_ctype . model return get_template ( template_path . format ( material_object ) ) . render ( { material_object : obj } )
Fetches template based on the type of the material.
Fetches template based on the type of the material .
"""
    Fetches template based on the type of the material. Works based on the Polymorphic c_type

    :param _context: Context of the page it is loaded from
    :param obj: StudyMaterialEdition object. Is used to retrieve the
    :param template_path: string to the relative path to find the template which should be rendered
    :return: template which is loaded
    """
template which is loaded
template which is loaded
_context
Context of the page it is loaded from
Context of the page it is loaded from
obj
StudyMaterialEdition
StudyMaterialEdition object. Is used to retrieve the
StudyMaterialEdition object . Is used to retrieve the
template_path
str
string to the relative path to find the template which should be rendered
string to the relative path to find the template which should be rendered