Flask-WhooshAlchemyWhoosh indexing capabilities for Flask-SQLAlchemy | |
Download |
Flask-WhooshAlchemy Ranking & Summary
Advertisement
- License:
- BSD License
- Price:
- FREE
- Publisher Name:
- Karl Gyllstrom
- Publisher web site:
- https://bitbucket.org/gyllstromk/
Flask-WhooshAlchemy Tags
Flask-WhooshAlchemy Description
Flask-WhooshAlchemy is a Flask extension that supports the easy text-indexing of SQLAlchemy model fields.Quick start example>>> import flask_whooshalchemy>>>>>> db = SQLAlchemy(app) # see flask-sqlalchemy>>>>>> class BlogPost(db.Model):... __tablename__ = 'blogpost'... __searchable__ = # these fields will be indexed by whoosh...... id = app.db.Column(app.db.Integer, primary_key=True)... title = app.db.Column(app.db.Text)... content = app.db.Column(app.db.Text)... created = db.Column(db.DateTime, default=datetime.datetime.utcnow)...... def __repr__(self):... return '{0}(title={1})'.format(self.__class__.__name__, self.title)...>>> app.config = 'path/to/whoosh/base'>>> m = BlogPost(title='My cool title', content='This is the first post.')>>> db.session.add(m); db.session.commit()>>>>>> print BlogPost.search_query('cool')... >>> print BlogPost.search_query('first')... Product's homepage
Flask-WhooshAlchemy Related Software