Entries from 2018-05-03 to 1 day

Updating and Deleting Records Section 5, Lecture 25

データの更新方法 Query the record Overide the current value Commit to db >> u = Book.query.get(16) >>> u The Sacred Book of Kairo by Heidi Zimmerman >>> u.id 16 >>> u.format 'ePub' >>> u.format = 'Revised_ePub' >>> db.session.commit() >>> …

Querying Data Section 5, Lecture 23

データを取り込む フィルターで絞ってデータを取得する Publicationテーブルにデータを取り込む >>> from run import db, Book, Publication >>> p1 = Publication("test1") >>> p2 = Publication("Paramount Press") >>> p3 = Publication("Oracle Books In…

Section 5 Performing CRUD operations

クラスの見方 float, string, Date Timeなど色々な定義お方法がある。 class Book(db.Model): __tablename__ = 'book' id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(500), nullable=False, index=True) avg_rating = db.Colum…