mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +02:00
Add category to the database
This commit is contained in:
parent
24ffdeb1ec
commit
b229e1a6c4
2 changed files with 12 additions and 4 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue