Flask-SQLAlchemy - Whoosh Integration
Project description
Adds Whoosh integration to Flask-SQLAlchemy.
Setup
Flask-Whooshee supports two different methods of setting up the extension. You can either initialize it directly, thus binding it to a specific application instance:
app = Flask(__name__)
whooshee = Whooshee(app)
and the second is to use the factory pattern which will allow you to configure whooshee at a later point:
whooshee = Whooshee()
def create_app():
app = Flask(__name__)
whooshee.init_app(app)
return app
Now you can create a basic whoosheer:
@whooshee.register_model('title', 'content')
class Entry(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String)
content = db.Column(db.Text)
and finally you can search the model:
Entry.query.whooshee_search('chuck norris').order_by(Entry.id.desc()).all()
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flask-whooshee-0.6.0.tar.gz
(13.3 kB
view details)
File details
Details for the file flask-whooshee-0.6.0.tar.gz
.
File metadata
- Download URL: flask-whooshee-0.6.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d8e9213df3ab1c64602ad653725fadd3204500d021fc85cec6ee3b05a10d4f |
|
MD5 | c94edf1156bc27a759f0dcfb7df4e323 |
|
BLAKE2b-256 | 88c2d0e47ef7bd07a856463df86a7e9c0e5cdd64cd9b8515f096ddcfc462857c |