devartis / passbook

Python library to create Apple Passbook (.pkpass) files
http://www.devartis.com/
MIT License
272 stars 108 forks source link

How to change barcode format #45

Closed kevxlreee closed 6 years ago

kevxlreee commented 6 years ago

How to change the barcode format to something other than the default PDF417?

If I do passfile.barcode = Barcode(message = 'message', format=BarcodeFormat.CODE128) I get a NameError - name 'BarcodeFormat' is not defined.

Sorry for my noob question :)

mbaechtold commented 6 years ago

Did you import the class BarcodeFormat?

from passbook.models import BarcodeFormat

If you did, could you please provide a more complete example of your code?

kevxlreee commented 6 years ago

Oops...I hadn't imported that class. It works now :)

Thanks for your help!