示例#1
0
def unique():
    data = request.json
    contract = data['contract']
    ooi_contracts = data['ooi_contracts']
    e = EtherscanService()
    addresses = e.unique_users(contract, ooi_contracts)
    return AddressSerializer.render_json(addresses)
示例#2
0
class PersonFullPostSerializer(HashPkSerializerBase):

    addresses = AddressSerializer(many=True, allow_add_remove=True)
    phones = PhoneSerializer(many=True, allow_add_remove=True)
    emergency_contact = EmergencyContactSerializer(many=True,
                                                   allow_add_remove=True)

    class Meta:

        model = Person
        fields = ('id', 'person_type', 'reason_for_change', 'relationship',
                  'first_name', 'last_name', 'middle_name', 'ssn', 'email',
                  'birth_date', 'phones', 'addresses', 'company', 'user',
                  'emergency_contact', 'gender')
示例#3
0
class CompanyPostSerializer(HashPkSerializerBase):

    addresses = AddressSerializer(many=True, allow_add_remove=True)
    contacts = PersonPostSerializer(many=True, allow_add_remove=True)

    class Meta:

        model = Company
        fields = ('id',
                  'name',
                  'pay_period_definition',
                  'contacts',
                  'addresses',
                  'ein')
示例#4
0
class PersonSerializer(HashPkSerializerBase):

    addresses = AddressSerializer(many=True)
    phones = PhoneSerializer(many=True)
    emergency_contact = EmergencyContactSerializer(many=True)
    company = HashField(source="company.id")
    user = HashField(source="user.id")

    class Meta:

        model = Person
        fields = ('id', 'person_type', 'reason_for_change', 'relationship',
                  'first_name', 'last_name', 'middle_name', 'email',
                  'birth_date', 'phones', 'addresses', 'company', 'user',
                  'emergency_contact', 'gender')
示例#5
0
class CompanySerializer(HashPkSerializerBase):

    addresses = AddressSerializer(many=True)
    contacts = PersonSerializer(many=True)
    pay_period_definition = SysPeriodDefinitionSerializer()

    class Meta:

        model = Company
        fields = ('id',
                  'name',
                  'pay_period_definition',
                  'contacts',
                  'addresses',
                  'ein')
示例#6
0
def in_common(contracts):
    li_contracts = list(contracts.split(','))
    e = EtherscanService()
    addresses_in_common = e.addresses_in_common(li_contracts)
    return AddressSerializer.render_json(addresses_in_common)
示例#7
0
def addresses(contract):
    e = EtherscanService()
    addresses = e.addresses_by_contract(contract)
    return AddressSerializer.render_json(addresses)