Example #1
0
class Elements(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.Text, unique=True)
    classifications = db.relationship('Classifications',
                                      backref='element',
                                      lazy='select',
                                      cascade="save-update, merge, delete")

    def __repr__(self):
        return self.name
Example #2
0
class JournalEntries(db.Model):
    id = db.Column(db.Text, primary_key=True)
    memoranda_transactions_id = db.Column(
        db.Text, db.ForeignKey('memoranda_transactions.id'))
    ledgerentries = db.relationship(
        'LedgerEntries',
        backref='journalentry',
        lazy='select',
        cascade="save-update, merge, delete",
        order_by="desc(LedgerEntries.tside), desc(LedgerEntries.amount)")
Example #3
0
class Subaccounts(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.Text, unique=True)
    parent = db.Column(db.Text, db.ForeignKey('accounts.name'))
    ledgerentries = db.relationship('LedgerEntries',
                                    backref='subaccount',
                                    lazy='select',
                                    cascade="save-update, merge, delete")

    def __repr__(self):
        return self.name
Example #4
0
class Classifications(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.Text, unique=True)
    parent = db.Column(db.Text, db.ForeignKey('elements.name'))
    accounts = db.relationship('Accounts',
                               backref='classification',
                               lazy='select',
                               cascade="save-update, merge, delete")

    def __repr__(self):
        return self.name
Example #5
0
class LedgerEntries(db.Model):
    id = db.Column(db.Text, primary_key=True)
    date = db.Column(db.DateTime)
    tside = db.Column(db.Text)
    amount = db.Column(db.Numeric)
    currency = db.Column(db.Text)
    ledger = db.Column(db.Text, db.ForeignKey('subaccounts.name'))
    journal_entry_id = db.Column(db.Text, db.ForeignKey('journal_entries.id'))
Example #6
0
class Memoranda(db.Model):
    id = db.Column(db.Text, primary_key=True)
    date = db.Column(db.DateTime, index=True)
    fileName = db.Column(db.Text, unique=True)
    fileType = db.Column(db.Text)
    fileSize = db.Column(BigInteger)
    fileText = db.Column(db.Text)
Example #7
0
class BitcoinTransactions(db.Model):
    # txid of the bitcoins received
    txid = db.Column(db.Text, primary_key=True)
    # output index of the bitcoins received
    output_index = db.Column(db.Integer, primary_key=True)
    # address the bitcoins were received with
    output_address = db.Column(db.Text)
    amount = db.Column(BigInteger)
    unspent = db.Column(db.Boolean)
    last_updated = db.Column(db.DateTime)
    memoranda_transactions_id = db.Column(
        db.Text, db.ForeignKey('memoranda_transactions.id'))
Example #8
0
class MemorandaTransactions(db.Model):
    id = db.Column(db.Text, primary_key=True)
    txid = db.Column(db.Text)
    details = db.Column(JSON)
    memoranda_id = db.Column(db.Text, db.ForeignKey('memoranda.id'))
Example #9
0
class Rates(db.Model):
    date = db.Column(db.BigInteger, primary_key=True)
    source = db.Column(db.Text)
    currency = db.Column(db.Text)
    rate = db.Column(db.Numeric)
Example #10
0
class PriceFeeds(db.Model):
    price_id = db.Column(db.Integer, primary_key=True)
    timestamp = db.Column(db.BigInteger)
    price = db.Column(db.Numeric)
    volume = db.Column(db.Numeric)