<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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