code: def get_content_type(obj, field_name=False):
      
      content_type = ContentType.objects.get_for_model(obj)
      if field_name:
          return getattr(content_type, field_name, '')
      return content_type
docs: Returns the content type of an object.
  
      :param obj: A model instance.
      :param field_name: Field of the object to return.