Skip to content

Commit b4dd254

Browse files
committed
Fixed sample attachable code in readme.
1 parent d6c98c5 commit b4dd254

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,21 +243,26 @@ Review results for batch operation:
243243
for error in fault.Error:
244244
print "Error " + error.Message
245245

246+
Attachments
247+
----------------
246248

247249
Adding attachments (See `Attachable documentation`_ for list of valid file types):
248250

249251
::
250252

251253
attachment = Attachable()
252254

253-
attachment.AttachableRef = AttachableRef()
254-
attachment.AttachableRef.EntityRef = entity.to_ref()
255+
attachable_ref = AttachableRef()
256+
attachable_ref = .EntityRef = entity.to_ref()
257+
258+
attachment.AttachableRef.append(attachable_ref)
255259

256260
attachment.FileName = 'Filename'
257261
attachment._FilePath = 'full path to file'
258262
attachment.ContentType = 'application/pdf'
259263
attachment.save(qb=qb)
260264

265+
261266
**Note:** Objects and object property names match their Quickbooks
262267
counterparts and do not follow PEP8.
263268

0 commit comments

Comments
 (0)