def serialize(self, value, primitive=False):
        """Serialize this field."""
        if hasattr(value, 'serialize'):
            # i.e. value is a nested model
            return value.serialize(primitive=primitive)
        else:
            return value
def serialize ( self , value , primitive = False ) : if hasattr ( value , 'serialize' ) : return value . serialize ( primitive = primitive ) else : return value
Serialize this field.