def render_change_form(self, request, context, **kwargs):
form = context['<STR_LIT>'].form<EOL>fieldsets = [(None, {'<STR_LIT>': form.fields.keys()})]<EOL>adminform = helpers.AdminForm(form, fieldsets,<EOL>self.prepopulated_fields)<EOL>media = mark_safe(self.media + adminform.media)<EOL>context.update(adminform=adminform, media=media)<EOL>super_meth = super(BaseEntityAdmin, self).render_change_form<EOL>return super_meth(request, context, **kwargs)<EOL>
Wrapper for ModelAdmin.render_change_form. Replaces standard static
AdminForm with an EAV-friendly one. The point is that our form generates
fields dynamically and fieldsets must be inferred from a prepared and
validated form instance, not just the form class. Django does not seem
to provide hooks for this purpose, so we simply wrap the view and
substitute some data.