Example #1
0
    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'
)

CreateStatementItemLeaf = get_create_mutation(StatementItem, statement_item_fields, StatementItemLeaf)
UpdateStatementItemLeaf = get_update_mutation(StatementItem, statement_item_fields, StatementItemLeaf)
Example #2
0
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'
)

CreateAccountLeaf = get_create_mutation(Account, account_fields, AccountLeaf)
UpdateAccountLeaf = get_update_mutation(Account, account_fields, AccountLeaf)
Example #3
0
    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"
)

CreateSubjectLeaf = get_create_mutation(Subject, subject_fields, SubjectLeaf)
UpdateSubjectLeaf = get_update_mutation(Subject, subject_fields, SubjectLeaf)
Example #4
0
__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)
Example #5
0
__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)
Example #6
0
__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)
Example #7
0
__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)
Example #8
0
    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'
)

CreateCounterpartyLeaf = get_create_mutation(Counterparty, counterparty_fields, CounterpartyLeaf)
UpdateCounterpartyLeaf = get_update_mutation(Counterparty, counterparty_fields, CounterpartyLeaf)
Example #9
0

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"
)

CreateOrganisationLeaf = get_create_mutation(Organisation, organisation_fields, OrganisationLeaf)
UpdateOrganisationLeaf = get_update_mutation(Organisation, organisation_fields, OrganisationLeaf)
Example #10
0
    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'
)

CreateNominalAccountLeaf = get_create_mutation(NominalAccount, nominal_account_fields, NominalAccountLeaf)
UpdateNominalAccountLeaf = get_update_mutation(NominalAccount, nominal_account_fields, NominalAccountLeaf)
Example #11
0
__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)
Example #12
0
__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)