-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'AttributeError' when runserver restart #13
Comments
You can add the following statement at the end of models.py |
thanks a lot |
Seems the doc is a little misleading as there are no metion about |
For those who are using this within the FlaskBB framework, app = create_app(Config) |
Modified quickstart according to gyllstromk#13
hi:
model/epo.py:
from cscsearch.extensions import db
import flask.ext.whooshalchemy
import datetime
class Epo(db.Model):
tablename = 'epo'
searchable = ['title', 'doc']
views/epo.py:
from cscsearch.models import Anonymous, User, LoginUser, Log, Epo
epo = Blueprint("epo", name)
@epo.route('/', methods=['GET','POST'])
def index():
if request.method == 'POST':
se = request.form['se']
if se:
art = Epo.query.whoosh_search(se)
else:
art = Epo.query.all()
else:
art = Epo.query.all()
return render_template("epodoc.html",art=art)
when add some new content, it will work well. But when Flask runserver restart, it will show "AttributeError: 'BaseQuery' object has no attribute 'whoosh_search'".
The text was updated successfully, but these errors were encountered: