In your models.py put:
from django.db import models
@classmethod
def model_field_exists(cls, field):
try:
cls._meta.get_field(field)
return True
except models.FieldDoesNotExist:
return False
models.Model.field_exists = model_field_exists
Now use it like this:
MyModel.field_exists('some_field')
# > True or False