first commit
This commit is contained in:
0
models/__init__.py
Normal file
0
models/__init__.py
Normal file
BIN
models/__pycache__/__init__.cpython-39.pyc
Normal file
BIN
models/__pycache__/__init__.cpython-39.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
models/__pycache__/transactions.cpython-39.pyc
Normal file
BIN
models/__pycache__/transactions.cpython-39.pyc
Normal file
Binary file not shown.
32
models/transactions.py
Normal file
32
models/transactions.py
Normal file
@ -0,0 +1,32 @@
|
||||
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])
|
Reference in New Issue
Block a user