forked from misaka10055/exhentai-database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.py
64 lines (48 loc) · 1.6 KB
/
model.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.orm import sessionmaker
import os
Base = declarative_base()
basedir = os.path.abspath(os.path.dirname(__file__))
engine = create_engine('sqlite:///' + os.path.join(basedir, 'ehDatabase.sqlite'))
DBSession = sessionmaker(bind=engine)
session = DBSession()
class Work(Base):
__tablename__ = 'ehWorkList'
id = Column(Integer, primary_key=True)
name = Column(String)
category = Column(String)
language = Column(String)
parody = Column(String)
character = Column(String)
female = Column(String)
male = Column(String)
group = Column(String)
artist = Column(String)
misc = Column(String)
uploader = Column(String)
pages = Column(String)
uploadTime = Column(String)
def __repr__(self):
return "<User(name='%s')>" % self.name
class Parody(Base):
__tablename__ = 'ehParodyList'
id = Column(Integer, primary_key=True)
workId = Column(Integer)
parody = Column(String)
def __repr__(self):
return "<User(workID='%s')>" % self.workId
class Character(Base):
__tablename__ = 'ehCharacterList'
id = Column(Integer, primary_key=True)
workId = Column(Integer)
character = Column(String)
def __repr__(self):
return "<User(workID='%s')>" % self.workId
class Female(Base):
__tablename__ = 'ehFemaleList'
id = Column(Integer, primary_key=True)
workId = Column(Integer)
parody = Column(String)
def __repr__(self):
return "<User(workID='%s')>" % self.workId