parameters: (model, downgrade=None, upgrade=None)
return_statement: return attrsetter('_returns', (model, downgrade, upgrade))
docstring: Return a decorator for methods that return instances of ``model``.
  
          :param model: a model name, or ``'self'`` for the current model
  
          :param downgrade: a function ``downgrade(self, value, *args, **kwargs)``
              to convert the record-style ``value`` to a traditional-style output
  
          :param upgrade: a function ``upgrade(self, value, *args, **kwargs)``
              to convert the traditional-style ``value`` to a record-style output
  
          The arguments ``self``, ``*args`` and ``**kwargs`` are the ones passed
          to the method in the record-style.
  
          The decorator adapts the method output to the api style: ``id``, ``ids`` or
          ``False`` for the traditional style, and recordset for the record style::
  
              @model
              @returns('res.partner')
              def find_partner(self, arg):
                  ...     # return some record
  
              # output depends on call style: traditional vs record style
              partner_id = model.find_partner(cr, uid, arg, context=context)
  
              # recs = model.browse(cr, uid, ids, context)
              partner_record = recs.find_partner(arg)
  
          Note that the decorated method must satisfy that convention.
  
          Those decorators are automatically *inherited*: a method that overrides
          a decorated existing method will be decorated with the same
          ``@returns(model)``.
docstring_summary: Return a decorator for methods that return instances of ``model``.
docstring_tokens: Return a decorator for methods that return instances of model .
function: def returns(model, downgrade=None, upgrade=None):
      """ Return a decorator for methods that return instances of ``model``.
  
          :param model: a model name, or ``'self'`` for the current model
  
          :param downgrade: a function ``downgrade(self, value, *args, **kwargs)``
              to convert the record-style ``value`` to a traditional-style output
  
          :param upgrade: a function ``upgrade(self, value, *args, **kwargs)``
              to convert the traditional-style ``value`` to a record-style output
  
          The arguments ``self``, ``*args`` and ``**kwargs`` are the ones passed
          to the method in the record-style.
  
          The decorator adapts the method output to the api style: ``id``, ``ids`` or
          ``False`` for the traditional style, and recordset for the record style::
  
              @model
              @returns('res.partner')
              def find_partner(self, arg):
                  ...     # return some record
  
              # output depends on call style: traditional vs record style
              partner_id = model.find_partner(cr, uid, arg, context=context)
  
              # recs = model.browse(cr, uid, ids, context)
              partner_record = recs.find_partner(arg)
  
          Note that the decorated method must satisfy that convention.
  
          Those decorators are automatically *inherited*: a method that overrides
          a decorated existing method will be decorated with the same
          ``@returns(model)``.
      """
      return attrsetter('_returns', (model, downgrade, upgrade))
function_tokens: def returns ( model , downgrade = None , upgrade = None ) : return attrsetter ( '_returns' , ( model , downgrade , upgrade ) )