forked from wsjdata/clinton-email-cruncher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhrcemail_common.py
More file actions
32 lines (27 loc) · 809 Bytes
/
Copy pathhrcemail_common.py
File metadata and controls
32 lines (27 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# encoding: utf-8
from peewee import *
db = SqliteDatabase("hrcemail.sqlite")
class BaseModel(Model):
class Meta:
database = db
class Document(BaseModel):
docID = CharField(max_length=9,unique=True,primary_key=True)
subject = CharField(null=True)
documentClass = CharField()
pdfLink = CharField()
originalLink = CharField(null=True)
docDate = DateField(null=True)
postedDate = DateField()
#from is a reserved word
messageFrom = CharField(db_column="from",null=True)
to = CharField(null=True)
messageNumber = CharField(null=True)
caseNumber = CharField()
docText = TextField(null=True)
class Name(BaseModel):
originalName = CharField(primary_key=True)
commonName = CharField()
db.connect()
#create tables if they don't exist
db.create_tables([Document,Name],True)