peewee的代码风格符合直觉,使用简单,学习成本相对较低,推荐测试开发同学使用。
from peewee import *
import datetime
db = SqliteDatabase(‘my_database.db’)
class BaseModel(Model):
class Meta:
database = db
class User(BaseModel):
username = CharField(unique=True)
class Tweet(BaseModel):
user = ForeignKeyField(User, backref=’tweets’)
message = TextField()
created_date = DateTimeField(default=datetime.datetime.now)
is_published = BooleanField(default=True)
项目地址:
安全测试
fsociety Hacking Tools
请登录之后再进行评论