Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_field_cls(self, field):
str_fields = (models.CharField, models.TextField, models.UUIDField)
if isinstance(field, str_fields):
return StrField
elif isinstance(field, (models.AutoField, models.IntegerField)):
return IntField
elif isinstance(field, (models.BooleanField, models.NullBooleanField)):
return BoolField
elif isinstance(field, (models.DecimalField, models.FloatField)):
return FloatField
elif isinstance(field, models.DateTimeField):
return DateTimeField
elif isinstance(field, models.DateField):
return DateField
return DjangoQLField