#NEWLINE# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# '\n        Collection field queryset is overridden to display only\n        collections managed by the given user.\n\n        ``user`` should not be passed to the superclass\n        ``__init__`` method.\n        ' #NEWLINE# self . _user = kwargs . pop ( 'user' , None ) #NEWLINE# super ( UserCollectionsForm , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# if self . _user : #NEWLINE# #INDENT# managed_collections = models . Collection . userobjects . get_query_set ( ) . get_managed_by_user ( self . _user ) #NEWLINE# self . fields [ 'collection' ] . queryset = managed_collections #NEWLINE# self . fields [ 'collection' ] . choices = ( [ ( mc . pk , mc . name ) for mc in args ] + [ ( '' , '---------' ) ] )