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

Uploaded Source

File details

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

File metadata

  • Download URL: flask-whooshee-0.7.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for flask-whooshee-0.7.0.tar.gz
Algorithm Hash digest
SHA256 9ee837503eaead2a81554f0e01c2647f0240f247b0b5b01b431c8cb67617ff31
MD5 34734ffadec5fdad50509786504c5c19
BLAKE2b-256 8eb8570f3228ce40d325f6d1bb92998786dad11ade3855f23a7a6eff7f2898ef

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