- Timestamp:
- 12/17/13 16:58:32 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/selector.py
r2876 r2881 224 224 query_list = list(self.generate_query(selection_list)) 225 225 if len(query_list) > 0: 226 query = 'SELECT FROM $1 WHERE ' + ' || '.join(query_list) 226 original_query = self.get_query() 227 if len(original_query) == 0 or re.match('.*(SRC|FIELD)NAME.*',original_query): 228 query = 'SELECT FROM $1 WHERE ' + ' || '.join(query_list) 229 else: 230 query = 'SELECT FROM $1 WHERE (' + original_query + ') && (' + ' || '.join(query_list) + ')' 227 231 self._settaql(query) 228 232 … … 338 342 s = map(string.strip, pattern.split('~')) 339 343 if len(s) == 2 and s[0].isdigit() and s[1].isdigit(): 340 self.id = [int(s[0])-1,int(s[1])] 344 id0 = int(s[0]) 345 id1 = int(s[1]) 346 if id0 == 0: 347 self.id = id1 348 self.template = string.Template('FIELDNAME == regex(\'.+__${reg}$\')') 349 else: 350 self.id = [id0-1,id1] 351 self.template = string.Template('FIELDNAME == regex(\'.+__${reg}$\') && FIELDNAME != regex(\'.+__${optreg}$\')') 341 352 else: 342 353 raise RuntimeError('Invalid syntax: %s'%(pattern)) 343 self.template = string.Template('FIELDNAME == regex(\'.+__${reg}$\') && FIELDNAME != regex(\'.+__${optreg}$\')')344 354 else: 345 355 raise RuntimeError('Invalid syntax: %s'%(pattern))
Note:
See TracChangeset
for help on using the changeset viewer.