def build_standard_field(self, field_name, model_field):
field_mapping = ClassLookupDict(self.serializer_field_mapping)<EOL>field_class = field_mapping[model_field]<EOL>field_kwargs = self.get_field_kwargs(field_name, model_field)<EOL>if '<STR_LIT>' in field_kwargs:<EOL><INDENT>field_class = self.serializer_choice_field<EOL>valid_kwargs = {<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT:default>', '<STR_LIT>', '<STR_LIT:source>',<EOL>'<STR_LIT:label>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>'<EOL>}<EOL>for key in list(field_kwargs.keys()):<EOL><INDENT>if key not in valid_kwargs:<EOL><INDENT>field_kwargs.pop(key)<EOL><DEDENT><DEDENT><DEDENT>if not issubclass(field_class, ModelField):<EOL><INDENT>field_kwargs.pop('<STR_LIT>', None)<EOL><DEDENT>if not issubclass(field_class, CharField) and notissubclass(field_class, ChoiceField):<EOL><INDENT>field_kwargs.pop('<STR_LIT>', None)<EOL><DEDENT>if postgres_fields and isinstance(model_field,<EOL>postgres_fields.ArrayField):<EOL><INDENT>child_model_field = model_field.base_field<EOL>child_field_class, child_field_kwargs = self.build_standard_field(<EOL>'<STR_LIT>', child_model_field<EOL>)<EOL>field_kwargs['<STR_LIT>'] = child_field_class(**child_field_kwargs)<EOL><DEDENT>return field_class, field_kwargs<EOL>
Create regular model fields.