mirror of
https://github.com/solero/houdini.git
synced 2024-11-12 13:48:20 +00:00
Item type check methods created within Item class
This commit is contained in:
parent
eaf8f4ccbc
commit
651896c20e
@ -15,6 +15,34 @@ class Item(db.Model):
|
||||
tour = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
release_date = db.Column(db.Date, nullable=False, server_default=db.text("now()"))
|
||||
|
||||
def is_color(self):
|
||||
return self.type == 1
|
||||
|
||||
def is_head(self):
|
||||
return self.type == 2
|
||||
|
||||
def is_face(self):
|
||||
return self.type == 3
|
||||
|
||||
def is_neck(self):
|
||||
return self.type == 4
|
||||
|
||||
def is_body(self):
|
||||
return self.type == 5
|
||||
|
||||
def is_hand(self):
|
||||
return self.type == 6
|
||||
|
||||
def is_feet(self):
|
||||
return self.type == 7
|
||||
|
||||
def is_flag(self):
|
||||
return self.type == 8
|
||||
|
||||
def is_photo(self):
|
||||
return self.type == 9
|
||||
|
||||
|
||||
|
||||
class PenguinItem(db.Model):
|
||||
__tablename__ = 'penguin_item'
|
||||
|
Loading…
Reference in New Issue
Block a user