Skip to main content

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()

Project details


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.9.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

flask_whooshee-0.9.1-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file flask-whooshee-0.9.1.tar.gz.

File metadata

  • Download URL: flask-whooshee-0.9.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for flask-whooshee-0.9.1.tar.gz
Algorithm Hash digest
SHA256 4770a4b8a0425ad39654a9ec62930fb94d4c4e600505cb589314c0ba35201ae2
MD5 b2f8e3c3be79dceb2013acba22f69c5d
BLAKE2b-256 c95a861bd48c6b48a2ec1049d399cccb4bc55059037e28acc0c7487e4694f00a

See more details on using hashes here.

File details

Details for the file flask_whooshee-0.9.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flask_whooshee-0.9.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a0dde9f59b0f171c911d6d39d237b19a50e2b432775a23a9f2b188a3cbafea77
MD5 cb2b65a16a9a5d5bc23fdc02aa4cb02c
BLAKE2b-256 e7ece75a2139daff74963218812d4c85afdecc9618046a2b560eae50a52a9e2b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page