# HG changeset patch # User Daniele Nicolodi # Date 1318583131 -7200 # Node ID d034b1541bf1bbc32647cb8c98e8daf2a6ddf51b # Parent 5bf7dc63466d12415dbfa863d18f3ab827f325ad Fixes to named queries management interface. diff -r 5bf7dc63466d -r d034b1541bf1 src/ltpdarepo/query.py --- a/src/ltpdarepo/query.py Fri Oct 14 10:57:26 2011 +0200 +++ b/src/ltpdarepo/query.py Fri Oct 14 11:05:31 2011 +0200 @@ -66,7 +66,6 @@ def tostring(self): criteria = json.loads(self.query) - print criteria query = ["%s %s '%s'" % (field, op, value) for field, op, value in criteria] string = ' AND '.join(s.replace(' ', ' ') for s in query) return Markup(string) diff -r 5bf7dc63466d -r d034b1541bf1 src/ltpdarepo/views/queries.py --- a/src/ltpdarepo/views/queries.py Fri Oct 14 10:57:26 2011 +0200 +++ b/src/ltpdarepo/views/queries.py Fri Oct 14 11:05:31 2011 +0200 @@ -63,8 +63,8 @@ if request.method == 'POST' and form.validate(): form.update(query) query.save() - return redirect(url_for('.index')) - return render_template('queries/edit.html', form=form) + return redirect(url_for('.view', id=id)) + return render_template('queries/edit.html', form=form, query=query) class IConfirm(Form): @@ -86,7 +86,7 @@ flash('Named query deleted.') return redirect(url_for('manage.queries.index')) flash('Operation cancelled.') - return redirect(url_for('manage.queries.index')) + return redirect(url_for('.view', id=id)) return render_template('queries/drop.html', form=form, query=query)