#NEWLINE# def conform_to_value( self , owner , value ) : #NEWLINE# #INDENT# '\n        When no root node has been set, we prompt the user to choose one from\n        the list of choices.  Otherwise, we set the ``WidgyWidget`` class as\n        the widget we use for this field instance.\n        ' #NEWLINE# self . owner = owner #NEWLINE# if isinstance ( value , Node ) : #NEWLINE# #INDENT# self . node = value #NEWLINE# try : #NEWLINE# #INDENT# self . widget . widget . node = value #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# self . widget . node = value #NEWLINE# #UNINDENT# self . queryset = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# choices = [ c for c in self . choices if c [ 0 ] ] #NEWLINE# if ( len ( choices ) == 1 ) : #NEWLINE# #INDENT# self . _value = choices [ 0 ] [ 0 ] #NEWLINE# self . widget = DisplayWidget ( display_name = choices [ 0 ] [ 1 ] ) #NEWLINE# self . help_text = _ ( 'You must save before you can edit this.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . widget = ContentTypeRadioSelect ( choices = choices ) #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# self . widget . widget . site = self . site #NEWLINE# self . widget . widget . owner = self #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# self . widget . site = self . site #NEWLINE# self . widget . owner = owner