-
-
Save jackeyGao/6a68100a0298895c6ef92869669a12c2 to your computer and use it in GitHub Desktop.
全宋词爬虫数据模型脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
File Name: db.py | |
Author: JackeyGao | |
mail: junqi.gao@shuyun.com | |
''' | |
from peewee import * | |
db = SqliteDatabase('ci.db') | |
class CiAuthor(Model): | |
value = IntegerField(primary_key=True) | |
name = CharField() | |
long_desc = TextField(null=True) | |
short_desc = TextField(null=True) | |
class Meta: | |
database = db # This model uses the "people.db" database. | |
class Ci(Model): | |
value = IntegerField(primary_key=True) | |
rhythmic = CharField() | |
author = CharField() | |
content = TextField(null=True) | |
class Meta: | |
database = db | |
#def delete_note(): | |
# return Note.delete().execute() | |
# | |
#def delete_image(): | |
# return Image.delete().execute() | |
def init_table(): | |
db.connect() | |
db.create_tables([Ci, CiAuthor]) | |
if __name__ == '__main__': | |
init_table() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment