code: def _get_serializable_model(cls):
          
          current_class = cls
          while current_class._meta.proxy:
              current_class = current_class._meta.proxy_for_model
          return current_class
docs: Returns a model with a valid _meta.local_fields (serializable).
  
          Basically, this means the original model, not a proxied model.
  
          (this is a workaround for a bug in django)