Nickname list in alias batched together
authorDmitriy Morozov <morozov@cs.duke.edu>
Sat, 17 May 2008 04:35:06 -0400
changeset 3 1626ee683a86
parent 2 b8013798cbfc
child 4 2a543aeac83d
Nickname list in alias batched together
alexandria.py
--- a/alexandria.py	Sat May 17 04:25:28 2008 -0400
+++ b/alexandria.py	Sat May 17 04:35:06 2008 -0400
@@ -110,8 +110,13 @@
         session.flush()
 
     print "Nicknames:"
-    for an in AuthorNickname.query.all():
-        print '  %s: %s' % (an.name, an.author.name)
+    for a in Author.query.all():
+        if len(a.nicknames) > 0:
+            print '  ' + a.name + ':',
+            for an in a.nicknames[:-1]:
+                print an.name + ',',
+            #print '%s: %s' % (a.nicknames[-1], a.name)
+            print a.nicknames[-1]
 
 def _set_options(p, options, required = []):
     title = options.title or ('title' in required) and raw_input("Enter title: ")