optimize imports

This commit is contained in:
zhangshine 2015-06-06 17:51:52 +08:00
parent eb4de6e43e
commit 884f56783f
3 changed files with 13 additions and 0 deletions

View file

@ -2,6 +2,9 @@ from __future__ import unicode_literals
class PDFInfo(object):
"""
PDF Properties
"""
def __init__(self, title=None, author=None, subject=None):
self.title = title
self.author = author
@ -77,6 +80,13 @@ class Transaction(object):
Transaction information
"""
def __init__(self, gateway, transaction_id, transaction_datetime, amount):
"""
:param gateway: Payment gateway like Paypal, Stripe etc.
:param transaction_id:
:param transaction_datetime:
:param amount: $$
:return:
"""
self.gateway = gateway
self.transaction_id = transaction_id
self.transaction_datetime = transaction_datetime

View file

@ -5,6 +5,7 @@ from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Paragraph
from pyinvoice.components import SimpleTable, TableWithHeader, PaidStamp
from pyinvoice.models import PDFInfo, Item, Transaction, InvoiceInfo, ServiceProviderInfo, ClientInfo

View file

@ -1,8 +1,10 @@
from datetime import datetime
from decimal import Decimal
from pyinvoice.models import InvoiceInfo, ServiceProviderInfo, ClientInfo, Item, Transaction
from pyinvoice.templates import SimpleInvoice
doc = SimpleInvoice('test.pdf')
doc.is_paid = True