-
Notifications
You must be signed in to change notification settings - Fork 12
Entities
rienafairefr edited this page Jun 19, 2017
·
1 revision
all objects in nYnab have the same base type, they are all entities, with a unique identifier (a uuid, field named id
).
To create new entities, be it a transaction, a payee, just look at the schema for it. e.g. for payees:
class Payee(Base, BudgetEntity):
auto_fill_amount = Column(AmountType)
auto_fill_amount_enabled = Column(String)
auto_fill_memo = Column(String)
auto_fill_memo_enabled = Column(String)
auto_fill_subcategory_enabled = Column(String)
auto_fill_subcategory_id = Column(ForeignKey('subcategory.id'))
auto_fill_subcategory = relationship('SubCategory', foreign_keys=auto_fill_subcategory_id)
enabled = Column(Boolean, default=True)
entities_account_id = Column(ForeignKey('account.id'))
entities_account = relationship('Account', foreign_keys=entities_account_id)
internal_name = Column(String)
name = Column(String)
rename_on_import_enabled = Column(String)
In order to create a payee, just fill in the parameters you want (the ones you don't need can usually be left unfilled/default)
from pynYnab.schema.budget import Payee
paye = Payee(auto_fill_amount=...,enabled=...,internal_name=...) etc.