

def render(self, form, form_style, context, template_pack=TEMPLATE_PACK, **kwargs):
    content = ''
    if (not self.css_id):
        self.css_id = '-'.join(['accordion', text_type(randint(1000, 9999))])
    self.open_target_group_for_form(form)
    for group in self.fields:
        group.data_parent = self.css_id
        content += render_field(group, form, form_style, context, template_pack=template_pack, **kwargs)
    template = self.get_template_name(template_pack)
    context.update({
        'accordion': self,
        'content': content,
    })
    return render_to_string(template, context.flatten())

dataset/ETHPy150Open maraujop/django-crispy-forms/crispy_forms/bootstrap.py Accordion.render/original