Esempio n. 1
0
class TestsWithInitApp(BaseTestCases.BaseTest):

    def setUp(self):
        self.pw = PonyWhoosh()
        self.pw.init_app(self.app)

        super(TestsWithInitApp, self).setUp()
Esempio n. 2
0
    def setUp(self):
        self.pw = PonyWhoosh()
        self.pw.init_app(self.app)

        super(TestsWithInitApp, self).setUp()
Esempio n. 3
0
class TestsWithInitApp(BaseTestCases.BaseTest):
    def setUp(self):
        self.pw = PonyWhoosh()
        self.pw.init_app(self.app)

        super(TestsWithInitApp, self).setUp()
Esempio n. 4
0
 def setUp(self):
     self.pw = PonyWhoosh(self.app)
     super(TestsWithApp, self).setUp()
Esempio n. 5
0
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):
Esempio n. 6
0
    def setUp(self):
        self.pw = PonyWhoosh()
        self.pw.init_app(self.app)

        super(TestsWithInitApp, self).setUp()
Esempio n. 7
0
from pony.orm import Database
from flask_ponywhoosh import PonyWhoosh

db = Database()
pw = PonyWhoosh()