--- a/alexandria.py Mon May 31 19:53:56 2010 -0700
+++ b/alexandria.py Wed Aug 25 15:16:05 2010 -0700
@@ -64,8 +64,17 @@
def _complete_label(cfg, prefix, **opts):
return [t.name for t in Tag.query.filter(Tag.name.startswith(unicode(prefix))).order_by(asc(Tag.name)).all()]
+def _complete_author(cfg, prefix, **opts):
+ nicknames = [an.name for an in AuthorNickname.query.filter(AuthorNickname.name.startswith(unicode(prefix)))]
+ # TODO: for now no authors, how do we deal with spaces in the names?
+ # authors = [a.name for a in Author.query.filter(Author.name.startswith(unicode(prefix)))]
+ result = nicknames # + authors
+ result.sort()
+ return result
+
+
laopts = [('l', 'label', [], 'label of the document', _complete_label),
- ('a', 'author', [], 'author of the document')]
+ ('a', 'author', [], 'author of the document', _complete_author)]
latopts = laopts + [('t', 'title', '', 'paper title')]