Add category to the database

This commit is contained in:
Arne Schlüter 2015-01-18 11:56:25 +01:00
commit b229e1a6c4
2 changed files with 12 additions and 4 deletions

View file

@ -26,7 +26,14 @@ class Location(BaseModel):
match = CharField()
article = ForeignKeyField(Article)
class Category(BaseModel):
"""
Describes the category of an incident (e.g. sexism, racism, antisemitism etc)
"""
name = CharField()
article = ForeignKeyField(Article)
# Set up the tables
def create_tables():
db.connect()
db.create_tables([Article, Location])
db.create_tables([Article, Location, Category])