#NEWLINE# def __init__( self , user , folder_id , * args , **kwargs ) : #NEWLINE# #INDENT# super ( WebLinkForm , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# self . fields [ 'title' ] . label = _ ( 'Title' ) #NEWLINE# self . fields [ 'title' ] . widget = TextInput ( attrs = { #NEWLINE# #INDENT# 'size' : '35' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . fields [ 'url' ] . label = _ ( 'URL' ) #NEWLINE# self . fields [ 'url' ] . initial = 'http://' #NEWLINE# self . fields [ 'url' ] . widget = TextInput ( attrs = { #NEWLINE# #INDENT# 'size' : '50' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . fields [ 'folder' ] . label = _ ( 'Folder' ) #NEWLINE# self . fields [ 'folder' ] . queryset = Object . filter_permitted ( kwargs , Folder . objects , mode = 'x' ) #NEWLINE# self . fields [ 'folder' ] . widget . attrs . update ( { #NEWLINE# #INDENT# 'popuplink' : reverse ( 'documents_folder_add' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# if folder_id : #NEWLINE# #INDENT# self . fields [ 'folder' ] . initial = folder_id #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . fields [ 'folder' ] . initial = self . fields [ 'folder' ] . queryset [ 0 ] . id #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass