Beispiel #1
0
def execute(command, args):
    eng = get_engine()
    for cmd in args[2:]:
        ret = eng.execute(cmd)
        try:
            print list(ret)
        except:
            # Proceed silently if the command produced no results
            pass
Beispiel #2
0
def execute(command, args):
    eng = get_engine()
    for cmd in args[2:]:
        ret = eng.execute(cmd)
        try:
            print list(ret)
        except:
            # Proceed silently if the command produced no results
            pass
from gearshift.paginate import paginate, sort_ordering, sort_data
from gearshift.testutil import sqlalchemy_cleanup
from turbojson.jsonify import jsonify

import cherrypy
from sqlalchemy import Table, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relation
from sqlobject import SQLObject, IntCol, StringCol, connectionForURI

query_methods = 'Q QA SO SL'.split()

config.update({"sqlalchemy.dburi": "sqlite:///:memory:"})

# sqlalchemy setup
sqlalchemy_cleanup()
get_engine()

# sqlobject setup
database.set_db_uri("sqlite:///:memory:")
__connection__ = hub = database.PackageHub('test_paginate')


class listlike(object):
    """A minimum list-like object that is needed for paginate."""
    def __init__(self, *args):
        self._list = list(*args)

    def __len__(self):
        return len(self._list)

    def __getitem__(self, key):
from gearshift.paginate import paginate, sort_ordering, sort_data
from gearshift.testutil import sqlalchemy_cleanup
from turbojson.jsonify import jsonify

import cherrypy
from sqlalchemy import Table, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relation
from sqlobject import SQLObject, IntCol, StringCol, connectionForURI

query_methods = 'Q QA SO SL'.split()

config.update({"sqlalchemy.dburi": "sqlite:///:memory:"})

# sqlalchemy setup
sqlalchemy_cleanup()
get_engine()

# sqlobject setup
database.set_db_uri("sqlite:///:memory:")
__connection__ = hub = database.PackageHub('test_paginate')


class listlike(object):
    """A minimum list-like object that is needed for paginate."""

    def __init__(self, *args):
        self._list = list(*args)

    def __len__(self):
        return len(self._list)
Beispiel #5
0
 def setUp(self):
     database.get_engine()
     database.metadata.create_all()