# HG changeset patch # User Daniele Nicolodi # Date 1314103097 -7200 # Node ID 0d259fd52ca0f0823e53f5515b9480fef47fd867 # Parent f4cbab388ed01dfcfd820a689e3d25173ee0f7ac Implement validation of advanced query parameters. While at it also rework the query infrastructure, I'm almost happy with it now. Named queries are broken by this change and will be fixed soon. Add dependency to `dateutil` package used for datetimes parsing. diff -r f4cbab388ed0 -r 0d259fd52ca0 buildout.cfg --- a/buildout.cfg Tue Aug 23 14:34:44 2011 +0200 +++ b/buildout.cfg Tue Aug 23 14:38:17 2011 +0200 @@ -1,4 +1,5 @@ [buildout] +include-site-packages = false parts = flask develop = src @@ -10,6 +11,7 @@ ordereddict argparse itsdangerous + python-dateutil < 2.0 ltpdarepo interpreter = python scripts = run admin diff -r f4cbab388ed0 -r 0d259fd52ca0 src/ltpdarepo/static/querywidget.js --- a/src/ltpdarepo/static/querywidget.js Tue Aug 23 14:34:44 2011 +0200 +++ b/src/ltpdarepo/static/querywidget.js Tue Aug 23 14:38:17 2011 +0200 @@ -16,7 +16,7 @@ var id = val; var name = val; if (typeof(val.name) !== 'undefined') { - id = val.val; + id = val.name; name = val.name; } // create options @@ -37,7 +37,7 @@ // create field name $.querywidget.createQueryField = function (index) { - var value = $.querywidget.config.indexes[index].val; + var value = $.querywidget.config.indexes[index].value; return $(document.createElement('input')).attr({ 'type': 'hidden', 'name': 'field', @@ -88,6 +88,10 @@ // configuration $.querywidget.config.indexes = criteria; + $("input.error").live('focus', function () { + $(this).removeClass('error'); + }); + $('#add').live('change', function () { var index = $(this).find(':selected')[0].value; if (! index) diff -r f4cbab388ed0 -r 0d259fd52ca0 src/ltpdarepo/static/style.css --- a/src/ltpdarepo/static/style.css Tue Aug 23 14:34:44 2011 +0200 +++ b/src/ltpdarepo/static/style.css Tue Aug 23 14:38:17 2011 +0200 @@ -558,21 +558,21 @@ background: #CFF09E; } -/* timespan selector */ +/* timerange selector */ -input.timespan-lo { +input.timerange-t1 { width: 197px; padding: 5px 10px; margin: 0; } -input.timespan-hi { +input.timerange-t2 { width: 197px; padding: 5px 10px; margin: 0; } -.timespan-label { +#timerange span { padding: 5px 10px; width: 60px; border-right: none; @@ -580,7 +580,6 @@ text-align: center; } - /* object display */ .obj { diff -r f4cbab388ed0 -r 0d259fd52ca0 src/ltpdarepo/templates/query.html --- a/src/ltpdarepo/templates/query.html Tue Aug 23 14:34:44 2011 +0200 +++ b/src/ltpdarepo/templates/query.html Tue Aug 23 14:38:17 2011 +0200 @@ -6,7 +6,7 @@