peewee

    2熱度

    1回答

    我正在使用flask-peewee來構建一個新項目。此外,我正在使用包含在瓶子peewee中的REST界面。我跟着這裏的例子http://flask-peewee.readthedocs.org/en/latest/getting-started.html#exposing-content-using-a-rest-api和http://flask-peewee.readthedocs.org/e

    2熱度

    1回答

    讓我們嘗試使用用戶和推文來解釋我的問題。 這是我的模型(從Peewee文檔): class User(BaseModel): username = CharField() class Tweet(BaseModel): user = ForeignKeyField(User, related_name='tweets') message = TextField()

    0熱度

    1回答

    我使用帶燒瓶peewee和wtfpeewee的燒瓶。 所以,我有模特那樣: class Category(Model): name = CharField() user = ForeignKeyField(User, null=True) class Record(Model): value = DecimalField() category = For

    2熱度

    1回答

    我試圖使用Google App Engine來部署一個BootlePy + PeeWee Web應用程序。 我使用PeeWee與SQLite。 這裏是PeeWee的源代碼: try: import sqlite3 except ImportError: sqlite3 = None 下面是我得到我的谷歌App Engine的發展控制檯錯誤: ImportError: No

    2熱度

    1回答

    我在Linux中第一次進行web開發,稍後將其移植到嵌入式系統上,一旦它在linux機器上工作。 我有一個名爲登錄密碼在mydb數據庫中的表。我使用peewee作爲ORM進行連接。 這是我跑 from peewee import * mysql_db = MySQLDatabase('mydb', user='root',passwd='rakesh') class Login(Model):

    7熱度

    2回答

    我正在運行nosetest,它具有需要加載與生產數據庫不同的數據庫的設置功能。我使用的ORM是peewee,它要求定義模型的數據庫。 所以我需要設置一個條件變量,但我不知道使用什麼條件來檢查nosetest是否正在運行該文件。 我閱讀堆棧溢出,你可以檢查nosesys.modules,但我想知道是否有更確切的方法來檢查鼻子是否運行。

    1熱度

    3回答

    有沒有人知道peewee所需的python的最低版本?我無法在任何地方找到它。

    1熱度

    1回答

    我在質疑自己關於新peewee的功能:commit_on_success裝飾。 如何確定函數是否爲「成功」? 如果我使用這個裝飾器,是否需要在我的修改過的對象上調用save()? 從我試過,我認爲#2是肯定的,但我只是想確保,因爲我沒有找到一個明確的答案peewee文檔中的這兩個問題。

    4熱度

    1回答

    爲了使一個擴展真的很乾淨,我試圖在python中實現「>>」運算符作爲類方法。但我不確定如何去解決它。我不想創建一個實例,因爲我真的在類本身上運行。 >>> class C: ... @classmethod ... def __rshift__(cls, other): ... print("%s got %s" % (cls, other)) ... >>> C.__rshi