  
  
  class Field(object):
      read_only = True
      creation_counter = 0
      empty = ''
 
</s> remove                 value = getattr(value, component)
                if is_simple_callable(value):
                    value = value()
 </s> add                 value = get_component(value, component) </s> remove                 many = hasattr(obj, '__iter__') and not isinstance(obj, Page)
 </s> add                 many = hasattr(obj, '__iter__') and not isinstance(obj, (Page, dict)) </s> remove             value = getattr(obj, field_name)
 </s> add             value = get_component(obj, field_name) </s> remove                 many = hasattr(data, '__iter__') and not isinstance(data, dict)
 </s> add                 many = hasattr(data, '__iter__') and not isinstance(data, (Page, dict)) </s> remove             many = hasattr(obj, '__iter__') and not isinstance(obj, Page)
 </s> add             many = hasattr(obj, '__iter__') and not isinstance(obj, (Page, dict))
def get_component(obj, attr_name):
    """
    Given an object, and an attribute name,
    return that attribute on the object.
    """
    if isinstance(obj, dict):
        val = obj[attr_name]
    else:
        val = getattr(obj, attr_name)

    if is_simple_callable(val):
        return val()
    return val


  
  
def get_component(obj, attr_name):
    """
    Given an object, and an attribute name,
    return that attribute on the object.
    """
    if isinstance(obj, dict):
        val = obj[attr_name]
    else:
        val = getattr(obj, attr_name)

    if is_simple_callable(val):
        return val()
    return val


  class Field(object):
      read_only = True
      creation_counter = 0
      empty = ''
keep add keep keep keep keep
 Allow serializers to handle dicts as well as objects.  Fixes #447. 
rest_framework/fields.py