Use table attribute instead of string in database order by (probably fixes #59)
This commit is contained in:
parent
7266c8018f
commit
0e5ef007f1
@ -116,7 +116,7 @@ class Collection(ical.Collection):
|
||||
items = (
|
||||
self.session.query(DBItem)
|
||||
.filter_by(collection_path=self.path, tag=item_type.tag)
|
||||
.order_by("name").all())
|
||||
.order_by(DBItem.name).all())
|
||||
for item in items:
|
||||
text = "\n".join(
|
||||
"%s:%s" % (line.key, line.value) for line in item.lines)
|
||||
@ -189,7 +189,7 @@ class Collection(ical.Collection):
|
||||
headers = (
|
||||
self.session.query(DBHeader)
|
||||
.filter_by(collection_path=self.path)
|
||||
.order_by("key").all())
|
||||
.order_by(DBHeader.key).all())
|
||||
return [
|
||||
ical.Header("%s:%s" % (header.key, header.value))
|
||||
for header in headers]
|
||||
|
Loading…
Reference in New Issue
Block a user