Returns the content type of an object.

    :param obj: A model instance.
    :param field_name: Field of the object to return.

def get_content_type(obj, field_name=False):
    """
    Returns the content type of an object.

    :param obj: A model instance.
    :param field_name: Field of the object to return.

    """
    content_type = ContentType.objects.get_for_model(obj)
    if field_name:
        return getattr(content_type, field_name, '')
    return content_type