# HG changeset patch # User Daniele Nicolodi # Date 1320407034 -3600 # Node ID 86c23f07c5ae32bcddda02488a11d0c42290dd97 # Parent b666c4b27e33987e6bedc9e626fbee8dc3a28671 Optimize check for xml data. diff -r b666c4b27e33 -r 86c23f07c5ae src/ltpdarepo/views/browse.py --- a/src/ltpdarepo/views/browse.py Fri Nov 04 12:18:10 2011 +0100 +++ b/src/ltpdarepo/views/browse.py Fri Nov 04 12:43:54 2011 +0100 @@ -446,16 +446,18 @@ # check for mat representation curs = g.db.cursor() - curs.execute("""SELECT obj_id FROM `%s`.bobjs WHERE obj_id=%%s""" % database, objid) + curs.execute("""SELECT obj_id + FROM `%s`.bobjs WHERE obj_id=%%s""" % database, objid) row = curs.fetchone() if row is not None: obj['mat'] = True # check for xml representation curs = g.db.cursor() - curs.execute("""SELECT xml, uuid FROM `%s`.objs WHERE id=%%s""" % database, objid) - xml, uuid = curs.fetchone() - if xml and xml.startswith('