[GRASS-SVN] r65533 - grass/branches/releasebranch_7_0/lib/python/pygrass/vector
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 2 00:03:14 PDT 2015
Author: zarch
Date: 2015-07-02 00:03:14 -0700 (Thu, 02 Jul 2015)
New Revision: 65533
Modified:
grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py
Log:
pygrass: backport r65531, that fix when methods arguments where not unicode
Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py 2015-07-02 06:32:09 UTC (rev 65532)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/vector/table.py 2015-07-02 07:03:14 UTC (rev 65533)
@@ -99,15 +99,13 @@
self._where = 'WHERE {condition}'.format(condition=condition)
return self
- def order_by(self, orderby):
+ def order_by(self, *orderby):
"""Create the order by condition
:param orderby: the name of column/s to order the result
:type orderby: str
"""
- if not isinstance(orderby, unicode):
- orderby = ', '.join(orderby)
- self._orderby = 'ORDER BY {orderby}'.format(orderby=orderby)
+ self._orderby = 'ORDER BY {orderby}'.format(orderby=', '.join(orderby))
return self
def limit(self, number):
@@ -122,15 +120,13 @@
self._limit = 'LIMIT {number}'.format(number=number)
return self
- def group_by(self, groupby):
+ def group_by(self, *groupby):
"""Create the group by condition
:param groupby: the name of column/s to group the result
:type groupby: str, list
"""
- if not isinstance(groupby, unicode):
- groupby = ', '.join(groupby)
- self._groupby = 'GROUP BY {groupby}'.format(groupby=groupby)
+ self._groupby = 'GROUP BY {groupby}'.format(groupby=', '.join(groupby))
return self
def get_sql(self):
More information about the grass-commit
mailing list