@@ -10,7 +10,8 @@ def to_json(self):
1010
1111 def json_filter (self ):
1212 """
13- filter out properties that have names starting with _ or properties that have a value of None
13+ filter out properties that have names starting with _
14+ or properties that have a value of None
1415 """
1516 return lambda obj : dict ((k , v ) for k , v in obj .__dict__ .items ()
1617 if not k .startswith ('_' ) and getattr (obj , k ) is not None )
@@ -85,23 +86,31 @@ class ListMixin(object):
8586 @classmethod
8687 def all (cls , start_position = "" , max_results = 100 , qb = None ):
8788 """
88- :param max_results: The maximum number of entities that can be returned in a response is 1000.
89+ :param start_position:
90+ :param max_results: The max number of entities that can be returned in a response is 1000.
91+ :param qb:
8992 :return: Returns list
9093 """
9194 return cls .where ("" , start_position = start_position , max_results = max_results , qb = qb )
9295
9396 @classmethod
9497 def filter (cls , start_position = "" , max_results = "" , qb = None , ** kwargs ):
9598 """
99+ :param start_position:
100+ :param max_results:
101+ :param qb:
96102 :param kwargs: field names and values to filter the query
97103 :return: Filtered list
98104 """
99- return cls .where (build_where_clause (** kwargs ), start_position = start_position , max_results = max_results , qb = qb )
105+ return cls .where (build_where_clause (** kwargs ),
106+ start_position = start_position , max_results = max_results , qb = qb )
100107
101108 @classmethod
102109 def choose (cls , choices , field = "Id" , qb = None ):
103110 """
104- :param kwargs: field names and values to filter the query
111+ :param choices:
112+ :param field:
113+ :param qb:
105114 :return: Filtered list
106115 """
107116 return cls .where (build_choose_clause (choices , field ), qb = qb )
@@ -110,6 +119,9 @@ def choose(cls, choices, field="Id", qb=None):
110119 def where (cls , where_clause = "" , start_position = "" , max_results = "" , qb = None ):
111120 """
112121 :param where_clause: QBO SQL where clause (DO NOT include 'WHERE')
122+ :param start_position:
123+ :param max_results:
124+ :param qb:
113125 :return: Returns list filtered by input where_clause
114126 """
115127 if where_clause :
@@ -121,14 +133,16 @@ def where(cls, where_clause="", start_position="", max_results="", qb=None):
121133 if max_results :
122134 max_results = " MAXRESULTS " + str (max_results )
123135
124- select = "SELECT * FROM {0} {1}{2}{3}" .format (cls .qbo_object_name , where_clause , start_position , max_results )
136+ select = "SELECT * FROM {0} {1}{2}{3}" .format (
137+ cls .qbo_object_name , where_clause , start_position , max_results )
125138
126139 return cls .query (select , qb = qb )
127140
128141 @classmethod
129142 def query (cls , select , qb = None ):
130143 """
131144 :param select: QBO SQL query select statement
145+ :param qb:
132146 :return: Returns list
133147 """
134148 if not qb :
@@ -152,4 +166,6 @@ def download_pdf(self, qb=None):
152166 if self .Id and self .Id > 0 and qb is not None :
153167 return qb .download_pdf (self .qbo_object_name , self .Id )
154168 else :
155- raise QuickbooksException ("Cannot download {0} when no Id is assigned or if no quickbooks client is passed in" .format (self .qbo_object_name ))
169+ raise QuickbooksException (
170+ "Cannot download {0} when no Id is assigned or if no quickbooks client is passed in" .format (
171+ self .qbo_object_name ))
0 commit comments