diff options
author | Joe Robinson <joe@lc8n.com> | 2021-11-28 18:19:49 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2021-11-28 18:19:49 +0000 |
commit | fe95b6f66726f3dcbbf3099bb9cf446a39cc2e20 (patch) | |
tree | 4f7b8658e02969bcde5fcb27d7b65f736680bb89 /models | |
parent | 439022f058cb2b9bbf6e2b46c067f4c828a1cab0 (diff) |
Add models
Diffstat (limited to 'models')
-rw-r--r-- | models/inventory.py | 12 | ||||
-rw-r--r-- | models/item.py | 11 | ||||
-rw-r--r-- | models/level.py | 9 | ||||
-rw-r--r-- | models/models.py | 0 |
4 files changed, 32 insertions, 0 deletions
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 --- /dev/null +++ b/models/models.py |