#NEWLINE# def __init__( self , query_or_model , paginate_by ) : #NEWLINE# #INDENT# self . paginate_by = paginate_by #NEWLINE# if isinstance ( query_or_model , SelectQuery ) : #NEWLINE# #INDENT# self . query = query_or_model #NEWLINE# self . model = self . query . model_class #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . model = query_or_model #NEWLINE# self . query = self . model . select ( )