summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
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