I came across an example when searching for sample python code:
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
I can understand up to title = peewee.TextField()
, but I'm a little confused with line class Meta: ...
. Why is that needed? Isn't there another way to establish a connection?