CSVConverterFirefly3/models/transactions.py

32 lines
871 B
Python
Raw Permalink Normal View History

2021-08-10 01:05:52 +07:00
from peewee import *
# Connect to a MySQL database on network.
db = MySQLDatabase('CSVConverter', user='rouggy', password='89DGgg290379',
host='192.168.1.15', port=3306)
class BaseModel(Model):
class Meta:
database = db
class Transactions(BaseModel):
account_short_name = TextField()
account_name = TextField()
type = TextField()
raw_line = CharField(unique=True, max_length=1000)
description = TextField()
asset_account = TextField()
opposing_account = TextField()
booking_date = DateField()
payment_date = DateField()
amount = FloatField()
currency = CharField(max_length=10)
foreign_currency_amount = FloatField()
foreign_currency_code = TextField()
category = TextField()
tag = TextField()
def create_tables():
with db:
db.create_tables([Transactions])