mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 11:13:40 +02:00
23 lines
549 B
Python
23 lines
549 B
Python
from peewee import *
|
|
|
|
db = SqliteDatabase('violence.db')
|
|
|
|
class BaseModel(Model):
|
|
class Meta:
|
|
database = db
|
|
|
|
class Article(BaseModel):
|
|
"""
|
|
An article is a single incident as crawled from the reach-out webpage
|
|
"""
|
|
date = DateField(index=True)
|
|
month_only = BooleanField(default=False)
|
|
place = CharField()
|
|
additional_place = CharField(null=True)
|
|
description = TextField()
|
|
hash = BlobField(index=True)
|
|
|
|
# Set up the tables
|
|
def create_tables():
|
|
database.connect()
|
|
database.create_tables([Article])
|