From fe95b6f66726f3dcbbf3099bb9cf446a39cc2e20 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Sun, 28 Nov 2021 18:19:49 +0000 Subject: Add models --- models/inventory.py | 12 ++++++++++++ models/item.py | 11 +++++++++++ models/level.py | 9 +++++++++ models/models.py | 0 4 files changed, 32 insertions(+) create mode 100644 models/inventory.py create mode 100644 models/item.py create mode 100644 models/level.py create mode 100644 models/models.py diff --git a/models/inventory.py b/models/inventory.py new file mode 100644 index 0000000..90f4cba --- /dev/null +++ b/models/inventory.py @@ -0,0 +1,12 @@ +from peewee import IntegerField, ForeignKeyField + +from base import BaseModel +from models.user import User +from models.item import Item + + +class Inventory(BaseModel): + + user = ForeignKeyField(User) + item = ForeignKeyField(Item) + stock = IntegerField(default=0) diff --git a/models/item.py b/models/item.py new file mode 100644 index 0000000..194b69c --- /dev/null +++ b/models/item.py @@ -0,0 +1,11 @@ +from peewee import TextField, IntegerField + +from base import BaseModel + + +class Item(BaseModel): + + name = TextField() + price = IntegerField() + text = TextField() + reward_rank = TextField(null=True) diff --git a/models/level.py b/models/level.py new file mode 100644 index 0000000..2dc61d9 --- /dev/null +++ b/models/level.py @@ -0,0 +1,9 @@ +from peewee import IntegerField, BigIntegerField + +from base import BaseModel + + +class Level(BaseModel): + level = IntegerField(primary_key=True) + exp_required = BigIntegerField() + reward_currency = IntegerField(null=True) diff --git a/models/models.py b/models/models.py new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3