peewee

    0熱度

    1回答

    我正在使用Peewee的model_form來更新數據庫中條目的實例。以下是我的表單,模板和應用程序的代碼。出於某種原因,當我提交表單時,我認爲我沒有收到POST,但是我正在編寫我的代碼,就像我過去一樣沒有任何問題。任何幫助,將不勝感激! 布賴恩 forms.py from flask_wtf import FlaskForm from wtforms import StringField, T

    1熱度

    1回答

    我對每個產品 ProductId (char) | Date | Sessions | UnitsSold sku01 | 2017-02-01 | 21 | 4 sku01 | 2017-02-02 | 14 | 3 sku01 | 2017-02-03 | 13 | 3 sku01 | 2017-02-06 | 14 | 2 sku01 | 2017-02-07 | 5 | 1 s

    1熱度

    1回答

    此代碼不能工作,並給JSON序列化的錯誤 class Bank(peewee.Model): // create Bank table bank_id = peewee.PrimaryKeyField() bank_name = peewee.CharField() account_no = peewee.CharField() ifc_code

    0熱度

    1回答

    我正在嘗試創建一個程序,其中包含從同一個數據庫讀取的3個進程。在我開始介紹流程之前,代碼正在工作。 從PeeWee執行select()時,我收到MemoryError,我懷疑共享資源有問題。小例子: models.py from playhouse.pool import PooledSqliteExtDatabase file_scanner_database = PooledSqliteE

    0熱度

    1回答

    我有一個對象(具有許多屬性),我想要複製的實例。 我使用deepcopy()複製它,然後修改幾個屬性。然後我使用Python/PeeWee save()將我的新對象保存到數據庫,但save()實際上更新了原始對象(我認爲這是因爲該ID是從原始對象複製的)。 (順便說一句無主鍵的對象模型中定義) 如何強制保存新對象?我可以改變它的ID嗎? 感謝。

    0熱度

    1回答

    我默認生成使用PooledMySQLDatabase與RetryOperationalError這樣的數據庫連接: from playhouse.shortcuts import RetryOperationalError from playhouse.pool import PooledMySQLDatabase class MySQLRetryDB(RetryOperationalEr

    -1熱度

    1回答

    我是Flask堆棧中的新成員。我需要運行一些項目。我創建的virtualenv並安裝所有要求: Flask==0.10.1 Flask-Login==0.3.1 Flask-Testing==0.4.2 Flask-WTF==0.12 Jinja2==2.8 MarkupSafe==0.23 WTForms==2.0.2 Werkzeug==0.10.4 argparse==1.2

    4熱度

    1回答

    一個大熊貓數據框使用PeeWee ORM我有以下查詢: query = DataModel.select()where(DataModel.field == "value") 有什麼辦法來query轉換成大熊貓數據幀不遍歷所有的值?我正在尋找更多的「Pythonic」做法。

    0熱度

    1回答

    而不是燒瓶peewee我使用普通peewee包。 以下是我正在初始化數據庫的方式: import os # just extending the BaseFlask with yaml config reader from . extensions.flask_app import Flask # peewee's wrapper around the database from pl

    0熱度

    1回答

    我試圖獲得給定字符串address在models.Listing.address中的結果列表。我此刻的代碼是: @app.route('/search/<address>') def search(address): results = models.Listing.select().where(address << models.Listing.address) retu