コード例 #1
0
        def test(database):
            text = "Test %s" % uuid.uuid4()
            obj1 = yield from peewee_async.create_object(TestModel, text=text)

            obj1.text = "Test update object"
            yield from peewee_async.update_object(obj1)

            obj2 = yield from peewee_async.get_object(TestModel,
                                                      TestModel.id == obj1.id)
            self.assertEqual(obj2.text, "Test update object")
コード例 #2
0
ファイル: __init__.py プロジェクト: dgelvin/peewee-async
        def test(database):
            text = "Test %s" % uuid.uuid4()
            obj1 = yield from peewee_async.create_object(
                TestModel, text=text)

            obj1.text = "Test update object"
            yield from peewee_async.update_object(obj1)

            obj2 = yield from peewee_async.get_object(
                TestModel, TestModel.id == obj1.id)
            self.assertEqual(obj2.text, "Test update object")
コード例 #3
0
        def update(query, only=None):

            if isinstance(query, UpdateQuery):
                return update(query)
            else:
                return update_object(query, only=only)