Skip to content

Instantly share code, notes, and snippets.

View tcmb's full-sized avatar

Florian tcmb

  • Berlin, Germany
View GitHub Profile
@tcmb
tcmb / ft_sample.xml
Last active May 30, 2016 15:29
Financial Transaction Export Sample
<!-- 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 -->
@tcmb
tcmb / puzzle.py
Created February 18, 2015 12:39
Python Puzzle
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
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)