def naturalize_model(self, model):
        if not isinstance(model.pk, PrimaryKeyNaturalQueryDescriptor):
            model.pk = PrimaryKeyNaturalQueryDescriptor()
        non_natural_fields = [field for field in model._meta.fields if
                              not isinstance(field, NaturalQueryField)]
        for field in non_natural_fields:
            if not hasattr(model, field.name):
                if isinstance(field, DateTimeField):
                    setattr(model, field.name, DateTimeNaturalQueryDescriptor(field.name))
                elif isinstance(field, DateField):
                    setattr(model, field.name, DateNaturalQueryDescriptor(field.name))
                else:
                    setattr(model, field.name, NaturalQueryDescriptor(field.name))
        non_natural_foreign_key_fields = [field for field in model._meta.fields if
                                          isinstance(field, RelatedField)]
        for field in non_natural_foreign_key_fields:
            relation_id_attribute_name = '%s_id' % field.name
            if not hasattr(model, relation_id_attribute_name):
                setattr(model, relation_id_attribute_name, NaturalQueryDescriptor(relation_id_attribute_name))
dataset/ETHPy150Open thedrow/django-natural-query/natural_query/apps.py/NaturalQueryConfig.naturalize_model/original