This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Exported amounts are rounded to two decimal places --> | |
<!-- For all statuses, we use numeric codes instead of strings and provide a mapping on a separate endpoint --> | |
<!-- Datetime stamp here is when the entire report was generated --> | |
<FinancialTransactionExport dateTime="2016-03-01T12:47:34.542145"> | |
<!-- One InvoiceHeader per SalesOrder --> | |
<SalesOrder> | |
<InvoiceHeader> | |
<FinancialTransactionID>23e4687e-1edf-4731-ad4e-1e84deea6c03</FinancialTransactionID> | |
<SalesOrderID>e259965b-8179-45cb-b1d7-82b6eb8babe8</SalesOrderID> | |
<!-- ID of the (paper) invoice sent to the consumer for this order --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyObject: | |
def __init__(self, name, id=None, properties={}): | |
self.key = (name) | |
if id: | |
self.key.append(id) | |
self.value = properties['value'] | |
def __str__(): | |
return "%s %s" % self.name, self.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from factory.alchemy import SQLAlchemyModelFactory | |
from factory import Sequence | |
from mymodels import SomeClass, OtherClass | |
class ItemFactory(SQLAlchemyModelFactory): | |
ABSTRACT_FACTORY = True | |
shared_counter = Sequence(lambda n: '{0}'.format(n)) | |
ItemFactory.reset_sequence(value=100, force=True) |