class TestsWithInitApp(BaseTestCases.BaseTest): def setUp(self): self.pw = PonyWhoosh() self.pw.init_app(self.app) super(TestsWithInitApp, self).setUp()
def setUp(self): self.pw = PonyWhoosh() self.pw.init_app(self.app) super(TestsWithInitApp, self).setUp()
def setUp(self): self.pw = PonyWhoosh(self.app) super(TestsWithApp, self).setUp()
app.config['PONYWHOOSH_DEBUG'] = True app.config['PONYWHOOSH_DIR'] = 'whooshes' app.config['PONYWHOOSH_MIN_STRING_LEN'] = 1 app.config['PONYWHOOSH_WRITER_TIMEOUT'] = 3 app.config['PONYWHOOSH_URL'] = '/ponywhoosh' # app.config['WHOOSHEE_TEMPLATE_PATH'] = 'app/static/templates/' # ----------------------------------------| app.config['SECRET_KEY'] = 'hard to guess string' bootstrap = Bootstrap(app) pw = PonyWhoosh(app) db = Database() @pw.register_model('number', 'name') class Department(db.Entity): number = PrimaryKey(int, auto=True) name = Required(str, unique=True) groups = Set("Group") courses = Set("Course") @pw.register_model('number', 'major') class Group(db.Entity):
from pony.orm import Database from flask_ponywhoosh import PonyWhoosh db = Database() pw = PonyWhoosh()