Fix minor formatting and comments issues.

This commit is contained in:
Pierre Rust 2014-07-02 13:05:33 +02:00
parent 18539b0bd1
commit cd1dcf6969
4 changed files with 5 additions and 5 deletions

View file

@ -505,7 +505,7 @@ class Results(object):
predicate.
"""
if self.sort:
# slow sort, must build the full list first
# Slow sort. Must build the full list first.
objects = []
for row in self.rows:
obj = self._generate_results(row)

View file

@ -535,7 +535,7 @@ class Sort(object):
class MultipleSort(Sort):
""" Sort class that combines several sort criteria.
"""Sort class that combines several sort criteria.
This implementation tries to implement as many sort operation in sql,
falling back to python sort only when necessary.
"""

View file

@ -150,4 +150,4 @@ def sort_from_strings(model_cls, sort_parts):
sort = query.MultipleSort()
for part in sort_parts:
sort.add_criteria(construct_sort_part(model_cls, part))
return sort
return sort

View file

@ -942,10 +942,10 @@ def get_query(val, model_cls):
# Add path queries to aggregate query.
if path_parts:
query.subqueries += [PathQuery('path', s) for s in path_parts]
return (query, sort)
return query, sort
elif isinstance(val, dbcore.Query):
return (val, None)
return val, None
else:
raise ValueError('query must be None or have type Query or str')