#NEWLINE# @ classmethod #NEWLINE# def get_templates_for( cls , user_username , user_source , public_value ) : #NEWLINE# #INDENT# q = cls . query #NEWLINE# q = q . filter ( ( cls . archived == False ) ) #NEWLINE# q = q . filter ( ( cls . is_template == True ) ) #NEWLINE# q = q . order_by ( cls . title ) #NEWLINE# q1 = q . filter ( ( cls . visibility == public_value ) ) #NEWLINE# q2 = q . join ( DataBoardManager ) #NEWLINE# q2 = q2 . filter ( ( DataBoardManager . user_username == user_username ) ) #NEWLINE# q2 = q2 . filter ( ( DataBoardManager . user_source == user_source ) ) #NEWLINE# q2 = q2 . filter ( ( cls . visibility != public_value ) ) #NEWLINE# return ( q1 , q2 )