def _register_elements(self, elements):
self.elements = elements<EOL>for key, obj in elements.items():<EOL><INDENT>obj.contribute_to_class(self.metadata, key)<EOL><DEDENT>fields = {}<EOL>for key, obj in elements.items():<EOL><INDENT>if obj.editable:<EOL><INDENT>field = obj.get_field()<EOL>if not field.help_text:<EOL><INDENT>if key in self.bulk_help_text:<EOL><INDENT>field.help_text = self.bulk_help_text[key]<EOL><DEDENT><DEDENT>fields[key] = field<EOL><DEDENT><DEDENT>base_meta = type('<STR_LIT:Meta>', (), self.original_meta)<EOL>class BaseMeta(base_meta):<EOL><INDENT>abstract = True<EOL>app_label = '<STR_LIT>'<EOL><DEDENT>fields['<STR_LIT:Meta>'] = BaseMeta<EOL>fields['<STR_LIT>'] = __name__ <EOL>self.MetadataBaseModel = type('<STR_LIT>' % self.name, (models.Model,), fields)<EOL>
Takes elements from the metadata class and creates a base model for all backend models .