| 693 | | |
| | 693 | |
| | 694 | def get_parameters(self): |
| | 695 | # this is a workaround for a bug that arises because the request argument is called "row" |
| | 696 | #but the query language syntax expects "rows" |
| | 697 | |
| | 698 | if self.constraints.has_key('row'): |
| | 699 | self.rows = self.constraints['row'] |
| | 700 | del self.constraints['row'] |
| | 701 | |
| | 702 | return {'constraints':self.constraints, |
| | 703 | 'col': self.cols, |
| | 704 | 'order':self.order, |
| | 705 | 'desc':self.desc, |
| | 706 | 'group': self.group, |
| | 707 | 'groupdesc':self.groupdesc, |
| | 708 | 'row': self.rows, |
| | 709 | 'page':self.page, |
| | 710 | 'max':self.max} |
| | 711 | |
| 762 | | qstring = qstring.replace('$USER', user) |
| 763 | | self.log.debug('QueryModule: Using default query: %s', str(qstring)) |
| 764 | | constraints = Query.from_string(self.env, qstring).constraints |
| 765 | | # Ensure no field constraints that depend on $USER are used |
| | 780 | qstring = qstring.replace('$USER', user) |
| | 781 | |
| | 782 | self.log.debug('QueryModule: Using default query: %s', str(qstring)) |
| | 783 | default_query = Query.from_string(self.env, qstring) |
| | 784 | |
| | 785 | constraints = default_query.constraints |
| | 786 | |
| | 787 | # rather than screw around with additional tests all down the line, we'll |
| | 788 | # just put fake "arguments" into the request object |
| | 789 | for field, value in default_query.get_parameters().items(): |
| | 790 | if not req.args.has_key(field): |
| | 791 | req.args[field] = value |
| | 792 | |
| | 793 | # Ensure no field constraints that depend on $USER are used |