コード例 #1
0
ファイル: tornadoasyncio.py プロジェクト: subssn21/notorm
    def get_all(cls):
        with (yield from notorm.db.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)) as cursor:
            yield from cursor.execute("""select game.*::game from game order by name""", {})

            results = yield from cursor.fetchall()
            games = notorm.build_relationships(results, "game")
        return games
コード例 #2
0
ファイル: tornadogevent.py プロジェクト: EricWorkman/notorm
    def get_all(cls):
        cursor = notorm.db.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)
        cursor.execute("""select game.*::game from game order by name""")

        results = cursor.fetchall()
        games = notorm.build_relationships(results, 'game')
        return games
コード例 #3
0
ファイル: tornadoasyncio.py プロジェクト: subssn21/notorm
    def get(cls, game_id):
        with (yield from notorm.db.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)) as cursor:
            yield from cursor.execute("""select game.*::game from game where id = %(game_id)s""", {"game_id": game_id})

            results = yield from cursor.fetchall()
            games = notorm.build_relationships(results, "game")
        if not games:
            return None
        return games[0]
コード例 #4
0
ファイル: tornadogevent.py プロジェクト: EricWorkman/notorm
    def get(cls, game_id):
        cursor = notorm.db.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)
        cursor.execute("""select game.*::game from game where id = %(game_id)s""",
                                 {'game_id': game_id})

        results = cursor.fetchall()
        games = notorm.build_relationships(results, 'game')
        if not games:
            return None
        return games[0]