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.8.2.tar.gz
(14.1 kB
view details)
File details
Details for the file flask-whooshee-0.8.2.tar.gz
.
File metadata
- Download URL: flask-whooshee-0.8.2.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1253a4d84020e557cb363944f271e83e6d67dabc8c345ff48a9e7403ae1bd5e |
|
MD5 | d4675339e73ce44360d925742ec67a28 |
|
BLAKE2b-256 | 3dbe12378e03f5a1a916d5a573fc63525a06f984618602954015a3aaa1c417e3 |