#NEWLINE# def get( self , * args , **kwargs ) : #NEWLINE# #INDENT# '\n        Returns a single instance matching this query, optionally with additional filter kwargs.\n\n        See :ref:`retrieving-objects-with-filters`\n\n        Returns a single object matching the QuerySet.\n\n        .. code-block:: python\n\n            user = User.get(id=1)\n\n        If no objects are matched, a :class:`~.DoesNotExist` exception is raised.\n\n        If more than one object is found, a :class:`~.MultipleObjectsReturned` exception is raised.\n        ' #NEWLINE# if ( args or kwargs ) : #NEWLINE# #INDENT# return self . filter ( * args , ** kwargs ) . get ( ) #NEWLINE# #UNINDENT# self . _execute_query ( ) #NEWLINE# try : #NEWLINE# #INDENT# self [ 1 ] #NEWLINE# raise self . model . MultipleObjectsReturned ( 'Multiple objects found' ) #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# obj = self [ 0 ] #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# raise self . model . DoesNotExist #NEWLINE# #UNINDENT# return obj