個人筆記。。
```
from peewee import *
db=SqliteDatabase('people.db')
class Person(Model):
??? name=CharField()
??? birthday=DateField()
??? is_relative=BooleaField()
??? class Meta:
??????? database=db
```
1.先導入peewee的包
2.建立一個NoSQL或者SQL的對象
3.建立一個model類 其中model類里包含Meta類
4. 進行數(shù)據(jù)庫的連接,如: db.connect()
5.進行數(shù)據(jù)庫的操作棒旗,如:db.creata_tables() 建議數(shù)據(jù)庫 或者用已經(jīng)建立的model類進行操作,如:Person.create(name='???',birthday='???',is_relative='???')
操作方式:Person.create(),Person.delete_instance(),Person.select().where(\w+='\w')? and? group_by(),having(),limt() and offset() , save(),insert(),update()。库北。。们陆。增刪查改
join() 連接?
?```
for x in Person.select().where() :
??? print x
```
疑問:class Meta 代表什么寒瓦?大概代表對sql語句查詢的限制條件..
明天繼續(xù)學習..peewee文檔鏈接?