@@ -21,20 +21,20 @@ Existing applications can continue to use OAuth 1.0 (See `OAuth 1.0 vs. OAuth 2.
2121Connecting your application with quickbooks-cli
2222-------------------
2323
24- From the commandline call quickbooks-cli tool passing in either your consumer_key and consumer_secret (OAuth 1.0)
24+ From the command line call quickbooks-cli tool passing in either your consumer_key and consumer_secret (OAuth 1.0)
2525or your client_id and client_secret (OAuth 2.0), plus the OAuth version number:
2626
2727 ::
2828
29- quickbooks-cli [-h] [-s] [-p PORT] consumer_key consumer_secret oauth_version
29+ quickbooks-cli [-h] [-s] [-p PORT] consumer_key consumer_secret oauth_version
3030
3131
3232Manually connecting with OAuth version 1.0
3333--------
3434
35351. Create the Authorization URL for your application:
3636
37- ::
37+ .. code-block :: python
3838
3939 from quickbooks import Oauth1SessionManager
4040
@@ -54,7 +54,7 @@ Manually connecting with OAuth version 1.0
5454
5555 2. Handle the callback:
5656
57- ::
57+ .. code-block :: python
5858
5959 session_manager = Oauth1SessionManager(
6060 sandbox = True ,
@@ -80,7 +80,7 @@ Manually connecting with OAuth version 2.0
8080
81811 . Create the Authorization URL for your application:
8282
83- ::
83+ .. code - block:: python
8484
8585 from quickbooks import Oauth2SessionManager
8686
@@ -101,7 +101,7 @@ Manually connecting with OAuth version 2.0
101101
1021022 . Handle the callback:
103103
104- ::
104+ .. code - block:: python
105105
106106 session_manager = Oauth2SessionManager(
107107 sandbox = True ,
@@ -122,7 +122,7 @@ Set up an OAuth session manager to pass to the QuickBooks client.
122122OAuth version 1.0 - Setup the session manager using the stored `` access_token`` and the
123123`` access_token_secret`` and `` realm_id`` :
124124
125- ::
125+ .. code - block:: python
126126
127127 session_manager = Oauth1SessionManager(
128128 sandbox = True ,
@@ -134,7 +134,7 @@ OAuth version 1.0 - Setup the session manager using the stored ``access_token``
134134
135135OAuth version 2.0 - Setup the session manager using the stored `` access_token`` and `` realm_id`` :
136136
137- ::
137+ .. code - block:: python
138138
139139 self .session_manager = Oauth2SessionManager(
140140 sandbox = True ,
@@ -145,7 +145,7 @@ OAuth version 2.0 - Setup the session manager using the stored ``access_token``
145145
146146Then create the QuickBooks client object passing in the session manager:
147147
148- ::
148+ .. code - block:: python
149149
150150 from quickbooks import QuickBooks
151151
@@ -158,7 +158,7 @@ Then create the QuickBooks client object passing in the session manager:
158158If you need to access a minor version (See `Minor versions` _ for
159159details) pass in minorversion when setting up the client:
160160
161- ::
161+ .. code - block:: python
162162
163163 client = QuickBooks(
164164 sandbox = True ,
@@ -172,26 +172,26 @@ details) pass in minorversion when setting up the client:
172172
173173You can disconnect the current Quickbooks Account like so (See `Disconnect documentation` _ for full details):
174174
175- ::
175+ .. code - block:: python
176176
177177 client.disconnect_account()
178178
179179If your consumer_key never changes you can enable the client to stay running:
180180
181- ::
181+ .. code - block:: python
182182
183183 QuickBooks.enable_global()
184184
185185You can disable the global client like so:
186186
187- ::
187+ .. code - block:: python
188188
189189 QuickBooks.disable_global()
190190
191191
192192List of objects:
193193
194- ::
194+ .. code - block:: python
195195
196196
197197 from quickbooks.objects.customer
@@ -203,59 +203,59 @@ number is 100. (See `Intuit developer guide`_ for details)
203203
204204Filtered list of objects:
205205
206- ::
206+ .. code-block :: python
207207
208208 customers = Customer.filter(Active = True , FamilyName = " Smith" , qb = client)
209209
210210 Filtered list of objects with paging:
211211
212- ::
212+ .. code-block :: python
213213
214214 customers = Customer.filter(start_position = 1 , max_results = 25 , Active = True , FamilyName = " Smith" , qb = client)
215215
216216 List Filtered by values in list:
217217
218- ::
218+ .. code-block :: python
219219
220220 customer_names = [' Customer1' , ' Customer2' , ' Customer3' ]
221221 customers = Customer.choose(customer_names, field = " DisplayName" , qb = client)
222222
223223 List with custom Where Clause (do not include the “WHERE”):
224224
225- ::
225+ .. code-block :: python
226226
227227 customers = Customer.where(" Active = True AND CompanyName LIKE 'S%'" , qb = client)
228228
229229 List with custom Where Clause and paging:
230230
231- ::
231+ .. code-block :: python
232232
233233 customers = Customer.where(" CompanyName LIKE 'S%'" , start_position = 1 , max_results = 25 , qb = client)
234234
235235 Filtering a list with a custom query (See `Intuit developer guide `_ for
236236supported SQL statements):
237237
238- ::
238+ .. code-block :: python
239239
240240 customer = Customer.query(" SELECT * FROM Customer WHERE Active = True" , qb = client)
241241
242242 Filtering a list with a custom query with paging:
243243
244- ::
244+ .. code-block :: python
245245
246246 customer = Customer.query(" SELECT * FROM Customer WHERE Active = True STARTPOSITION 1 MAXRESULTS 25" , qb = client)
247247
248248 Get single object by Id and update:
249249
250- ::
250+ .. code-block :: python
251251
252252 customer = Customer.get(1 , qb = client)
253253 customer.CompanyName = " New Test Company Name"
254254 customer.save(qb = client)
255255
256256 Create new object:
257257
258- ::
258+ .. code-block :: python
259259
260260 customer = Customer()
261261 customer.CompanyName = " Test Company"
@@ -270,7 +270,7 @@ full details).
270270
271271Batch create a list of objects:
272272
273- ::
273+ .. code-block :: python
274274
275275 from quickbooks.batch import batch_create
276276
@@ -288,7 +288,7 @@ Batch create a list of objects:
288288
289289 Batch update a list of objects:
290290
291- ::
291+ .. code-block :: python
292292
293293 from quickbooks.batch import batch_update
294294
@@ -300,7 +300,7 @@ Batch update a list of objects:
300300
301301 Batch delete a list of objects:
302302
303- ::
303+ .. code-block :: python
304304
305305 from quickbooks.batch import batch_delete
306306
@@ -310,7 +310,7 @@ Batch delete a list of objects:
310310
311311 Review results for batch operation:
312312
313- ::
313+ .. code-block :: python
314314
315315 # successes is a list of objects that were successfully updated
316316 for obj in results.successes:
@@ -328,7 +328,7 @@ Change Data Capture
328328Change Data Capture returns a list of objects that have changed since a given time (see `Change data capture `_ for more
329329details):
330330
331- ::
331+ .. code-block :: python
332332
333333 from quickbooks.cdc import change_data_capture
334334 from quickbooks.objects import Invoice
@@ -339,7 +339,7 @@ details):
339339
340340 Querying muliple entity types at the same time:
341341
342- ::
342+ .. code-block :: python
343343
344344 from quickbooks.objects import Invoice, Customer
345345
@@ -348,7 +348,7 @@ Querying muliple entity types at the same time:
348348
349349 If you use a ``datetime `` object for the timestamp, it is automatically converted to a string:
350350
351- ::
351+ .. code-block :: python
352352
353353 from datetime import datetime
354354
@@ -361,7 +361,7 @@ See `Attachable documentation`_ for list of valid file types, file size limits a
361361
362362Attaching a note to a customer:
363363
364- ::
364+ .. code-block :: python
365365
366366 attachment = Attachable()
367367
@@ -375,7 +375,7 @@ Attaching a note to a customer:
375375
376376 Attaching a file to customer:
377377
378- ::
378+ .. code-block :: python
379379
380380 attachment = Attachable()
381381
@@ -397,14 +397,14 @@ All objects include ``to_json`` and ``from_json`` methods.
397397
398398Converting an object to JSON data:
399399
400- ::
400+ .. code-block :: python
401401
402402 account = Account.get(1 , qb = client)
403403 json_data = account.to_json()
404404
405405 Loading JSON data into a quickbooks object:
406406
407- ::
407+ .. code-block :: python
408408
409409 account = Account()
410410 account.from_json(
@@ -420,7 +420,7 @@ Date formatting
420420When setting date or datetime fields, Quickbooks requires a specific format.
421421Formating helpers are available in helpers.py. Example usage:
422422
423- ::
423+ .. code-block :: python
424424
425425 date_string = qb_date_format(date(2016 , 7 , 22 ))
426426 date_time_string = qb_datetime_format(datetime(2016 , 7 , 22 , 10 , 35 , 00 ))
0 commit comments