""" from a_tuin.api import ( node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields ) from glod.api.subject_leaf import SubjectLeaf from glod.db.subject import Subject, SubjectQuery subject_fields = get_local_fields(Subject) SubjectNode = node_class(Subject.__name__, SubjectLeaf, subject_fields) subjects_connection_field = node_connection_field( Subject, SubjectQuery, SubjectNode, description="List of all subjects" ) subjects_options_field = node_connection_field( Subject, SubjectQuery, SubjectLeaf, description="List of all subjects for Select fields" )
""" from a_tuin.api import ( node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields ) from glod.api.statement_item_leaf import StatementItemLeaf from glod.db.statement_item import StatementItem, StatementItemQuery statement_item_fields = get_local_fields(StatementItem) StatementItemNode = node_class(StatementItem.__name__, StatementItemLeaf, statement_item_fields) statement_items_connection_field = node_connection_field( StatementItem, StatementItemQuery, StatementItemNode, description='List of all statement_items' ) statement_items_options_field = node_connection_field( StatementItem, StatementItemQuery, StatementItemLeaf, description='List of all statement_items for Select fields' )
get_local_fields ) from glod.api.account_leaf import AccountLeaf from glod.api.fund_node import FundLeaf from glod.db.account import Account, AccountQuery account_fields = get_local_fields(Account) account_node_fields = account_fields.copy() # TODO can we derive this from the model references? account_node_fields['funds'] = graphene.Field( graphene.List(FundLeaf, description='Funds for this account.') ) AccountNode = node_class(Account.__name__, AccountLeaf, account_node_fields) accounts_connection_field = node_connection_field( Account, AccountQuery, AccountNode, description='List of all bank accounts' ) accounts_options_field = node_connection_field( Account, AccountQuery, AccountLeaf, description='List of all bank accounts for select fields' )
__copyright__ = 'Copyright(c) Gordon Elliott 2017' """ """ import graphene from a_tuin.api import node_class, get_local_fields from a_tuin.unittests.api.fixtures.models import AClass, AReferringClass from a_tuin.unittests.api.fixtures.leaves import AClassLeaf, AReferringClassLeaf aclass_node_fields = get_local_fields(AClass) aclass_node_fields['refers'] = graphene.Field( graphene.List(AReferringClassLeaf)) AClassNode = node_class(AClass.__name__, AClassLeaf, aclass_node_fields) areferringclass_node_fields = get_local_fields(AReferringClass) AReferringClassNode = node_class(AReferringClass.__name__, AReferringClassLeaf, areferringclass_node_fields)
__copyright__ = 'Copyright(c) Gordon Elliott 2018' """ """ from a_tuin.api import (node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields) from glod.api.person_leaf import PersonLeaf from glod.db.person import Person, PersonQuery person_fields = get_local_fields(Person) PersonNode = node_class(Person.__name__, PersonLeaf, person_fields) persons_connection_field = node_connection_field( Person, PersonQuery, PersonNode, description="List of all people") persons_options_field = node_connection_field( Person, PersonQuery, PersonLeaf, description="List of all people for Select fields") CreatePersonLeaf = get_create_mutation(Person, person_fields, PersonLeaf) UpdatePersonLeaf = get_update_mutation(Person, person_fields, PersonLeaf)
__copyright__ = 'Copyright(c) Gordon Elliott 2018' """ """ from a_tuin.api import (node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields) from glod.api.address_leaf import AddressLeaf from glod.db.address import Address, AddressQuery address_fields = get_local_fields(Address) AddressNode = node_class(Address.__name__, AddressLeaf, address_fields) addresss_connection_field = node_connection_field( Address, AddressQuery, AddressNode, description="List of all addresss") addresss_options_field = node_connection_field( Address, AddressQuery, AddressLeaf, description="List of all addresss for Select fields") CreateAddressLeaf = get_create_mutation(Address, address_fields, AddressLeaf) UpdateAddressLeaf = get_update_mutation(Address, address_fields, AddressLeaf)
__copyright__ = 'Copyright(c) Gordon Elliott 2018' """ """ from a_tuin.api import (node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields) from glod.api.transaction_leaf import TransactionLeaf from glod.db.transaction import Transaction, TransactionQuery transaction_fields = get_local_fields(Transaction) TransactionNode = node_class(Transaction.__name__, TransactionLeaf, transaction_fields) transactions_connection_field = node_connection_field( Transaction, TransactionQuery, TransactionNode, description='List of all transactions') transactions_options_field = node_connection_field( Transaction, TransactionQuery, TransactionLeaf, description='List of all transactions for Select fields') CreateTransactionLeaf = get_create_mutation(Transaction, transaction_fields, TransactionLeaf) UpdateTransactionLeaf = get_update_mutation(Transaction, transaction_fields, TransactionLeaf)
__copyright__ = 'Copyright(c) Gordon Elliott 2018' """ """ from a_tuin.api import (node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields) from glod.api.organisation_address_leaf import OrganisationAddressLeaf from glod.db.organisation_address import OrganisationAddress, OrganisationAddressQuery organisation_address_fields = get_local_fields(OrganisationAddress) OrganisationAddressNode = node_class(OrganisationAddress.__name__, OrganisationAddressLeaf, organisation_address_fields) organisation_addresss_connection_field = node_connection_field( OrganisationAddress, OrganisationAddressQuery, OrganisationAddressNode, description="List of all organisation_addresss") CreateOrganisationAddressLeaf = get_create_mutation( OrganisationAddress, organisation_address_fields, OrganisationAddressLeaf) UpdateOrganisationAddressLeaf = get_update_mutation( OrganisationAddress, organisation_address_fields, OrganisationAddressLeaf)
""" from a_tuin.api import ( node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields ) from glod.api.counterparty_leaf import CounterpartyLeaf from glod.db.counterparty import Counterparty, CounterpartyQuery counterparty_fields = get_local_fields(Counterparty) CounterpartyNode = node_class(Counterparty.__name__, CounterpartyLeaf, counterparty_fields) counterparty_connection_field = node_connection_field( Counterparty, CounterpartyQuery, CounterpartyNode, description='List of all counterparties' ) counterparty_options_field = node_connection_field( Counterparty, CounterpartyQuery, CounterpartyLeaf, description='List of all counterparties for Select fields' )
from glod.api.person_node import PersonLeaf from glod.api.organisation_address_node import OrganisationAddressNode from glod.db.organisation import Organisation, OrganisationQuery organisation_fields = get_local_fields(Organisation) organisation_node_fields = organisation_fields.copy() organisation_node_fields['people'] = graphene.Field( graphene.List(PersonLeaf, description='People for this organisation') ) organisation_node_fields['organisation_addresses'] = graphene.Field( graphene.List(OrganisationAddressNode, description='Addresses for this organisation') ) OrganisationNode = node_class(Organisation.__name__, OrganisationLeaf, organisation_node_fields) organisations_connection_field = node_connection_field( Organisation, OrganisationQuery, OrganisationNode, description="List of all organisations" ) organisations_options_field = node_connection_field( Organisation, OrganisationQuery, OrganisationLeaf, description="List of all organisations for Select fields" )
""" from a_tuin.api import ( node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields ) from glod.api.nominal_account_leaf import NominalAccountLeaf from glod.db.nominal_account import NominalAccount, NominalAccountQuery nominal_account_fields = get_local_fields(NominalAccount) NominalAccountNode = node_class(NominalAccount.__name__, NominalAccountLeaf, nominal_account_fields) nominal_accounts_connection_field = node_connection_field( NominalAccount, NominalAccountQuery, NominalAccountNode, description='List of all nominal accounts' ) nominal_accounts_options_field = node_connection_field( NominalAccount, NominalAccountQuery, NominalAccountLeaf, description='List of all nominal accounts for Select fields' )
__copyright__ = 'Copyright(c) Gordon Elliott 2017' """ """ from a_tuin.api import (node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields) from glod.api.parishioner_leaf import ParishionerLeaf from glod.db.parish_list.parishioner import Parishioner, ParishionerQuery parishioner_fields = get_local_fields(Parishioner) ParishionerNode = node_class(Parishioner.__name__, ParishionerLeaf, parishioner_fields) parishioners_connection_field = node_connection_field( Parishioner, ParishionerQuery, ParishionerNode, description="List of all parishioners") parishioners_options_field = node_connection_field( Parishioner, ParishionerQuery, ParishionerLeaf, description="List of all parishioners for select fields") CreateParishionerLeaf = get_create_mutation(Parishioner, parishioner_fields, ParishionerLeaf) UpdateParishionerLeaf = get_update_mutation(Parishioner, parishioner_fields, ParishionerLeaf)
__copyright__ = 'Copyright(c) Gordon Elliott 2018' """ """ from a_tuin.api import (node_class, node_connection_field, get_update_mutation, get_create_mutation, get_local_fields) from glod.api.pps_leaf import PPSLeaf from glod.db.pps import PPS, PPSQuery pps_fields = get_local_fields(PPS) PPSNode = node_class(PPS.__name__, PPSLeaf, pps_fields) ppss_connection_field = node_connection_field(PPS, PPSQuery, PPSNode, description="List of all PPSes") ppss_options_field = node_connection_field( PPS, PPSQuery, PPSLeaf, description="List of all PPSes for Select fields") CreatePPSLeaf = get_create_mutation(PPS, pps_fields, PPSLeaf) UpdatePPSLeaf = get_update_mutation(PPS, pps_fields, PPSLeaf)