class GlobalStatsTO(TO): id = unicode_property('id') name = unicode_property('name') token_count = long_property('token_count') unlocked_count = long_property('unlocked_count') value = float_property('value') currencies = typed_property('currencies', CurrencyValueTO, True) # type: list[CurrencyValueTO] market_cap = float_property('market_cap')
class PointTO(object): lat = float_property('1') lon = float_property('2') @classmethod def create(cls, lat, lon): to = cls() to.lat = lat to.lon = lon return to
class Dummy(object): f1 = unicode_property('1') f2 = bool_property('2') f3 = float_property('3') f4 = long_property('4') f5 = unicode_list_property('5') f6 = typed_property('6', InnerDummy) f7 = typed_property('7', InnerDummy, True)
class CreateInvestmentAgreementTO(TO): app_user = unicode_property('app_user') amount = float_property('amount') currency = unicode_property('currency') document = unicode_property('document') token = unicode_property('token') status = long_property('status') sign_time = long_property('sign_time') paid_time = long_property('paid_time')
class InvestmentAgreementTO(TO): id = long_property('id') app_user = unicode_property('app_user') amount = float_property('amount') referrer = unicode_property('referrer') token = unicode_property('token') token_count = long_property('token_count') token_count_float = float_property('token_count_float') token_precision = float_property('token_precision') currency = unicode_property('currency') name = unicode_property('name') address = unicode_property('address') iyo_see_id = unicode_property('iyo_see_id') signature_payload = unicode_property('signature_payload') signature = unicode_property('signature') status = long_property('status') creation_time = long_property('creation_time') sign_time = long_property('sign_time') paid_time = long_property('paid_time') cancel_time = long_property('cancel_time') modification_time = long_property('modification_time') reference = unicode_property('reference') document_url = unicode_property('document_url')
class CustomerLocationTO(object): name = unicode_property('1') description = unicode_property('2') has_terminal = bool_property('3') lat = float_property('4') lon = float_property('5') address = unicode_property('6') type = long_property('7') def __init__(self, name=None, description=None, has_terminal=False, lat=None, lon=None, address=None, type_=None): self.name = name self.description = description self.has_terminal = has_terminal self.lat = lat self.lon = lon self.address = address self.type = type_
class CurrencyValueTO(TO): currency = unicode_property('currency') value = float_property('value') timestamp = long_property('timestamp') auto_update = bool_property('auto_update')
class NewTransactionTO(TO): token_count = float_property('token_count') memo = unicode_property('memo') date_signed = long_property('date_signed') token_type = unicode_property('token_type')
class ProspectTO(object): id = unicode_property('0') app_id = unicode_property('1') name = unicode_property('2') lat = float_property('3') lon = float_property('4') address = unicode_property('5') phone = unicode_property('6') website = unicode_property('7') types = unicode_list_property('8') status = long_property('9') reason = unicode_property('10') action_timestamp = long_property('11') assignee = unicode_property('12') email = unicode_property('13') comments = typed_property('14', ProspectComment, True) has_customer = bool_property('15') customer_id = long_property('16') certainty = long_property('17') subscription = long_property('18') categories = unicode_list_property('19') @classmethod def from_model(cls, model): if not model: return None to = cls() to.id = model.id to.app_id = model.app_id to.name = model.name if model.geo_point: to.lat = model.geo_point.lat to.lon = model.geo_point.lon else: to.lat = 0 to.lon = 0 to.address = model.address to.phone = model.phone to.website = model.website to.types = model.type to.status = model.status to.reason = model.reason to.action_timestamp = model.action_timestamp to.assignee = model.assignee to.email = model.email to.comments = list( ) if model.comments is None else model.comments.values() if model.customer_id is None: to.has_customer = False to.customer_id = -1 else: to.has_customer = True to.customer_id = model.customer_id if model.certainty is None: to.certainty = 0 else: to.certainty = model.certainty if model.subscription is None: to.subscription = 0 else: to.subscription = model.subscription to.categories = map(unicode, model.categories) return to