summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2021-11-28 18:19:49 +0000
committerJoe Robinson <joe@lc8n.com>2021-11-28 18:19:49 +0000
commitfe95b6f66726f3dcbbf3099bb9cf446a39cc2e20 (patch)
tree4f7b8658e02969bcde5fcb27d7b65f736680bb89 /models
parent439022f058cb2b9bbf6e2b46c067f4c828a1cab0 (diff)
Add models
Diffstat (limited to 'models')
-rw-r--r--models/inventory.py12
-rw-r--r--models/item.py11
-rw-r--r--models/level.py9
-rw-r--r--models/models.py0
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