【发布时间】:2013-07-08 08:38:13
【问题描述】:
我在搜索示例 python 代码时遇到了一个示例:
import peewee
from peewee import *
db = MySQLDatabase('jonhydb', user='john',passwd='megajonhy')
class Book(peewee.Model):
author = peewee.CharField()
title = peewee.TextField()
class Meta:
database = db
我最多可以理解title = peewee.TextField(),但我对class Meta: ... 行有点困惑。为什么需要这个?难道没有其他方法可以建立连接吗?
【问题讨论】:
-
这个related question 可能有用。
标签: python