#NEWLINE# def get_form_data( self , context , instance , placeholder ) : #NEWLINE# #INDENT# '\n        Returns data to initialize the corresponding dialog form.\n        This method must return a dictionary containing\n         * either `instance` - a Python object to initialize the form class for this plugin,\n         * or `initial` - a dictionary containing initial form data, or if both are set, values\n           from `initial` override those of `instance`.\n        ' #NEWLINE# if issubclass ( self . FormClass , DialogFormMixin ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# cart = CartModel . objects . get_from_request ( context [ 'request' ] ) #NEWLINE# cart . update ( context [ 'request' ] ) #NEWLINE# #UNINDENT# except CartModel . DoesNotExist : #NEWLINE# #INDENT# cart = None #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'cart' : cart , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# }