[Checkins] SVN: Sandbox/luciano/kirbi/src/kirbi/ search by authors and link to make that search in details.pt

Luciano Ramalho luciano at ramalho.org
Sun Jul 8 21:31:18 EDT 2007


Log message for revision 77641:
  search by authors and link to make that search in details.pt
  

Changed:
  U   Sandbox/luciano/kirbi/src/kirbi/app.py
  U   Sandbox/luciano/kirbi/src/kirbi/app_templates/master.pt
  U   Sandbox/luciano/kirbi/src/kirbi/book.py
  U   Sandbox/luciano/kirbi/src/kirbi/book_templates/details.pt
  U   Sandbox/luciano/kirbi/src/kirbi/demo/collection.py
  U   Sandbox/luciano/kirbi/src/kirbi/demo/dump.py
  U   Sandbox/luciano/kirbi/src/kirbi/demo/import.py
  U   Sandbox/luciano/kirbi/src/kirbi/pac.py
  U   Sandbox/luciano/kirbi/src/kirbi/pac_templates/index.pt

-=-
Modified: Sandbox/luciano/kirbi/src/kirbi/app.py
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/app.py	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/app.py	2007-07-09 01:31:15 UTC (rev 77641)
@@ -19,7 +19,11 @@
 
     title = index.Text()
     isbn13 = index.Field()
+    searchableText = index.Text()
     
+    #XXX: this is not working: the creatorSet book method is never called
+    creatorsSet = index.Set()
+    
 class Master(grok.View):
     """ The master page template macro """
     grok.context(Interface)

Modified: Sandbox/luciano/kirbi/src/kirbi/app_templates/master.pt
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/app_templates/master.pt	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/app_templates/master.pt	2007-07-09 01:31:15 UTC (rev 77641)
@@ -10,12 +10,16 @@
   <link rel="shortcut icon" type="image/vnd.microsoft.icon"
         tal:attributes="href static/favicon.ico" />
 
+  <script metal:define-slot="setfocus" type="text/javascript">
+        function setfocus() { document.forms[0].query.focus() }
+  </script>
+
   <metal:hdr define-slot="headers">
     <!-- Additional headers here... -->
   </metal:hdr>
 
 </head>
-<body>
+<body onload=setfocus()>
   <div class="top">
     <a tal:attributes="href python:view.application_url()">
         <img tal:attributes="src static/circulante-logo-transp-212x51.png"

Modified: Sandbox/luciano/kirbi/src/kirbi/book.py
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/book.py	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/book.py	2007-07-09 01:31:15 UTC (rev 77641)
@@ -180,8 +180,37 @@
     sub_title = property(getSubTitle)
 
     def creatorsLine(self):
-        return '; '.join(self.creators)
+        return ', '.join(self.creators)
+        
+    def creatorsListDict(self):
+        creators = []
+        for creator in self.creators:
+            name = creator.strip()
+            role = u''
+            if u'(' in creator: # remove role string
+                name = name.split(u'(')[0].strip()
+                if u')' in creator:
+                    role = creator[creator.find(u'(')+1:
+                                   creator.find(u')')].strip()
+            creators.append({'name':name, 'role':role})
+        return creators
 
+    def creatorsSet(self):
+        #XXX: this is never invoked so the creatorSet index in app.py is not
+        # being pupulated
+        creators = set()
+        for creator in self.creators():
+            if '(' in creator: # remove role string
+                creator = creator.split('(')[0]
+            creators.add(creator.strip().lower())
+        import pdb; pdb.set_trace()
+        return list(creators)
+    
+    def searchableText(self):
+        #XXX this however is working fine... so why isn't creatorsSet?
+        return self.title + ' ' + ' '.join(self.creators)
+
+
 class Edit(grok.EditForm):
     pass
 

Modified: Sandbox/luciano/kirbi/src/kirbi/book_templates/details.pt
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/book_templates/details.pt	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/book_templates/details.pt	2007-07-09 01:31:15 UTC (rev 77641)
@@ -23,7 +23,18 @@
 
     <table>
         <tr><th>Creators</th>
-            <td tal:content="context/creatorsLine">Joe Doe</td>
+            <td>
+                <tal:creator repeat="creator context/creatorsListDict">
+                    <tal:comment replace="nothing">Next few lines have weird
+                        indentation because of the need to control the spaces
+                        between names and the comma</tal:comment>
+                    <a tal:attributes="href python:view.application_url('pac')+
+                       '?query='+creator['name']" tal:content="creator/name">
+                    Joe Doe</a><tal:role condition="creator/role">
+                    (<span tal:replace="creator/role" />)</tal:role><tal:comma
+                       condition="not:repeat/creator/end">, </tal:comma>
+                </tal:creator>
+            </td>
         </tr>
         <tr><th>ISBN-13</th>
             <td tal:content="view/isbn13">9780123456789</td>

Modified: Sandbox/luciano/kirbi/src/kirbi/demo/collection.py
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/demo/collection.py	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/demo/collection.py	2007-07-09 01:31:15 UTC (rev 77641)
@@ -22,7 +22,7 @@
     {'edition': None,
      'isbn13': u'9780028618890',
      'issued': u'1997-09-23',
-     'name': u'Bryan Prafenberg; Lycos',
+     'name': u'Bryan Prafenberg|Lycos',
      'publisher': u'MacMillan Reference Books',
      'title': u"Webster's New World Pocket Internet Directory and Dictionary"},
     {'edition': u'New Ed',
@@ -34,7 +34,7 @@
     {'edition': u'Reissue',
      'isbn13': u'9780140449105',
      'issued': u'2003-05-06',
-     'name': u'Thomas More; Paul Turner (introduction)',
+     'name': u'Thomas More|Paul Turner (introduction)',
      'publisher': u'Penguin Classics',
      'title': u'Utopia (Penguin Classics)'},
     {'edition': u'Reprint',
@@ -58,7 +58,7 @@
     {'edition': u'1st',
      'isbn13': u'9780201633610',
      'issued': u'1995-01-15',
-     'name': u'Erich Gamma; Richard Helm; Ralph Johnson; John Vlissides',
+     'name': u'Erich Gamma|Richard Helm|Ralph Johnson|John Vlissides',
      'publisher': u'Addison-Wesley Professional',
      'title': u'Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional Computing Series)'},
     {'edition': u'New Ed',
@@ -76,7 +76,7 @@
     {'edition': None,
      'isbn13': u'9780785814269',
      'issued': u'2001-09-01',
-     'name': u'Brian Turnstall; Nicholas Tracy (editor)',
+     'name': u'Brian Turnstall|Nicholas Tracy (editor)',
      'publisher': u'Book Sales',
      'title': u'Naval Warfare in the Age of Sail: The Evolution of Fighting Tactics, 1650-1815'},
     {'edition': None,
@@ -118,31 +118,31 @@
     {'edition': None,
      'isbn13': u'9781841763088',
      'issued': u'2001-11-25',
-     'name': u'Angus Konstam; Tony Bryan (illustrator)',
+     'name': u'Angus Konstam|Tony Bryan (illustrator)',
      'publisher': u'Osprey Publishing',
      'title': u'British Napoleonic Ship-of-the-Line (New Vanguard)'},
     {'edition': None,
      'isbn13': u'9780850459982',
      'issued': u'1990-11-22',
-     'name': u'Rene Chartrand; Francis Back (illustrator)',
+     'name': u'Rene Chartrand|Francis Back (illustrator)',
      'publisher': u'Osprey Publishing',
      'title': u"Napoleon's Sea Soldiers (Men-at-Arms)"},
     {'edition': None,
      'isbn13': u'9781841766355',
      'issued': u'2004-05-25',
-     'name': u'Chris Henry; Brian Delf (illustrator)',
+     'name': u'Chris Henry|Brian Delf (illustrator)',
      'publisher': u'Osprey Publishing',
      'title': u'Napoleonic Naval Armaments 1792-1815 (New Vanguard)'},
     {'edition': u'New Ed',
      'isbn13': u'9781853266867',
      'issued': u'1999-02-01',
-     'name': u'John Terraine; J. N. Westwood',
+     'name': u'John Terraine|J. N. Westwood',
      'publisher': u'Combined Publishing',
      'title': u'Trafalgar (Wordsworth Collection)'},
     {'edition': u'New Ed',
      'isbn13': u'9780198605270',
      'issued': u'2002-10-17',
-     'name': u'Bryan Ranft; J. R. Hill (editor)',
+     'name': u'Bryan Ranft|J. R. Hill (editor)',
      'publisher': u'Oxford University Press, USA',
      'title': u'The Oxford Illustrated History of the Royal Navy'},
     {'edition': None,
@@ -160,7 +160,7 @@
     {'edition': u'New Ed',
      'isbn13': u'9781840222029',
      'issued': u'1999-04-01',
-     'name': u'Ernie Bradford; Ernle Dusgate Selby Bradford',
+     'name': u'Ernie Bradford|Ernle Dusgate Selby Bradford',
      'publisher': u'Wordsworth Military Library',
      'title': u'Nelson: The Essential Hero (Wordsworth Military Library)'},
     {'edition': u'Reprint',
@@ -292,7 +292,7 @@
     {'edition': u'3rd',
      'isbn13': u'9780805066159',
      'issued': u'2000-10-01',
-     'name': u'Dean King; John B. Hattendorf; J. Worth Estes',
+     'name': u'Dean King|John B. Hattendorf|J. Worth Estes',
      'publisher': u'Owl Books',
      'title': u"A Sea of Words, Third Edition: A Lexicon and Companion to the Complete Seafaring Tales of Patrick O'Brian"},
     {'edition': u'New Ed',
@@ -322,7 +322,7 @@
     {'edition': u'1st Da Capo Press ed',
      'isbn13': u'9780306805837',
      'issued': u'1994-09-01',
-     'name': u'B. H. Liddell Hart; Michael Grant',
+     'name': u'B. H. Liddell Hart|Michael Grant',
      'publisher': u'Da Capo Press',
      'title': u'Scipio Africanus: Greater Than Napoleon'},
     {'edition': None,
@@ -382,7 +382,7 @@
     {'edition': u'3',
      'isbn13': u'9780596003302',
      'issued': u'2002-10-01',
-     'name': u"Shelley Powers; Tim O'Reilly; Mike Loukides; Jerry Peek (editor)",
+     'name': u"Shelley Powers|Tim O'Reilly|Mike Loukides|Jerry Peek (editor)",
      'publisher': u"O'Reilly Media",
      'title': u'Unix Power Tools, Third Edition'},
     {'edition': u'2',
@@ -418,13 +418,13 @@
     {'edition': None,
      'isbn13': u'9780521377096',
      'issued': u'1989-09-29',
-     'name': u'Thomas C. Hayes; Paul Horowitz',
+     'name': u'Thomas C. Hayes|Paul Horowitz',
      'publisher': u'Cambridge University Press',
      'title': u'The Art of Electronics (Student Manual with Exercises)'},
     {'edition': u'2',
      'isbn13': u'9780521370950',
      'issued': u'1989-07-28',
-     'name': u'Paul Horowitz; Winfield Hill',
+     'name': u'Paul Horowitz|Winfield Hill',
      'publisher': u'Cambridge University Press',
      'title': u'The Art of Electronics'},
     {'edition': u'1',
@@ -442,7 +442,7 @@
     {'edition': u'1',
      'isbn13': u'9781593270049',
      'issued': u'2003-05-01',
-     'name': u'Ton Roosendaal; Carsten Wartmann',
+     'name': u'Ton Roosendaal|Carsten Wartmann',
      'publisher': u'No Starch Press',
      'title': u'The Official Blender GameKit: Interactive 3D for Artists'},
     {'edition': None,
@@ -466,13 +466,13 @@
     {'edition': None,
      'isbn13': u'9780675212625',
      'issued': u'1993-01-01',
-     'name': u'Patricia L. Smith; Tillman J. Ragan',
+     'name': u'Patricia L. Smith|Tillman J. Ragan',
      'publisher': u'Prentice Hall',
      'title': u'Instructional Design'},
     {'edition': u'Bk&CD-Rom',
      'isbn13': u'9780471116882',
      'issued': u'1996-03-01',
-     'name': u'Allison Druin; Cynthia Solomon',
+     'name': u'Allison Druin|Cynthia Solomon',
      'publisher': u'John Wiley & Sons',
      'title': u'Designing Multimedia Environments for Children'},
     {'edition': u'Reprint',
@@ -502,7 +502,7 @@
     {'edition': u'1st HarperPerennial Ed',
      'isbn13': u'9780062731029',
      'issued': u'1994-02-25',
-     'name': u'Larry Gonick; Woollcott Smith',
+     'name': u'Larry Gonick|Woollcott Smith',
      'publisher': u'Collins',
      'title': u'Cartoon Guide to Statistics'},
     {'edition': u'Reprint',
@@ -520,19 +520,19 @@
     {'edition': u'1',
      'isbn13': u'9781565925823',
      'issued': u'1999-01-01',
-     'name': u"Brian Behlendorf; Scott Bradner; Jim Hamerly; Kirk McKusick; Tim O'Reilly; Tom Paquin; Bruce Perens; Eric Raymond; Richard Stallman; Michael Tiemann; Linus Torvalds; Paul Vixie; Larry Wall; Bob Young; Chris Dibona (editor); Sam Ockman (editor); Mark Stone (editor)",
+     'name': u"Brian Behlendorf|Scott Bradner|Jim Hamerly|Kirk McKusick|Tim O'Reilly|Tom Paquin|Bruce Perens|Eric Raymond|Richard Stallman|Michael Tiemann|Linus Torvalds|Paul Vixie|Larry Wall|Bob Young|Chris Dibona (editor)|Sam Ockman (editor)|Mark Stone (editor)",
      'publisher': u"O'Reilly Media",
      'title': u"Open Sources: Voices from the Open Source Revolution (O'Reilly Open Source)"},
     {'edition': u'1st',
      'isbn13': u'9780060170301',
      'issued': u'1995-01-01',
-     'name': u'Michelle Slatalla; Joshua Quittner',
+     'name': u'Michelle Slatalla|Joshua Quittner',
      'publisher': u'Harpercollins',
      'title': u'Masters of Deception: The Gang That Ruled Cyberspace'},
     {'edition': None,
      'isbn13': u'9780670865482',
      'issued': u'1996-09-01',
-     'name': u'Michael Gates Gill; Sheila Paterson',
+     'name': u'Michael Gates Gill|Sheila Paterson',
      'publisher': u'Viking Adult',
      'title': u'Fired Up!: From Corporate Kiss Off Entrepreneurial Kick Off Take Charge your Destiny Our Do'},
     {'edition': u'Reprint',
@@ -1186,13 +1186,13 @@
     {'edition': u'New Ed',
      'isbn13': u'9780139376818',
      'issued': u'1984-03-01',
-     'name': u'Brian W. Kernighan; Rob Pike',
+     'name': u'Brian W. Kernighan|Rob Pike',
      'publisher': u'Prentice Hall',
      'title': u'The UNIX Programming Environment'},
     {'edition': u'Updated',
      'isbn13': u'9780393048476',
      'issued': u'1999-11-01',
-     'name': u'Lewis Carroll; Martin Gardner (editor); John Tenniel (illustrator)',
+     'name': u'Lewis Carroll|Martin Gardner (editor)|John Tenniel (illustrator)',
      'publisher': u'W. W. Norton & Company',
      'title': u'The Annotated Alice: The Definitive Edition'},
     {'edition': u'New Ed',
@@ -1240,7 +1240,7 @@
     {'edition': None,
      'isbn13': u'9780395730928',
      'issued': u'1997-03-31',
-     'name': u'Stephanie Gordon Tessler; Judith Ross Enderle; Brian Floca (illustrator)',
+     'name': u'Stephanie Gordon Tessler|Judith Ross Enderle|Brian Floca (illustrator)',
      'publisher': u'Houghton Mifflin',
      'title': u'Where Are You, Little Zack?'},
     {'edition': u'3',
@@ -1252,19 +1252,19 @@
     {'edition': None,
      'isbn13': u'9781932394610',
      'issued': u'2005-10-01',
-     'name': u'Dave Crane; Eric Pascarello; Darren James',
+     'name': u'Dave Crane|Eric Pascarello|Darren James',
      'publisher': u'Manning Publications',
      'title': u'Ajax in Action'},
     {'edition': u'2nd',
      'isbn13': u'9780974514055',
      'issued': u'2004-10-01',
-     'name': u'Dave Thomas; Chad Fowler; Andy Hunt',
+     'name': u'Dave Thomas|Chad Fowler|Andy Hunt',
      'publisher': u'Pragmatic Bookshelf',
      'title': u"Programming Ruby: The Pragmatic Programmers' Guide, Second Edition"},
     {'edition': u'1',
      'isbn13': u'9780976694007',
      'issued': u'2005-07-01',
-     'name': u'Dave Thomas; David Heinemeier Hansson; Andreas Schwarz; Thomas Fuchs; Leon Breedt; Mike Clark',
+     'name': u'Dave Thomas|David Heinemeier Hansson|Andreas Schwarz|Thomas Fuchs|Leon Breedt|Mike Clark',
      'publisher': u'Pragmatic Bookshelf',
      'title': u'Agile Web Development with Rails: A Pragmatic Guide (Pragmatic Programmers)'},
     {'edition': None,
@@ -1276,7 +1276,7 @@
     {'edition': u'Bk&CD-Rom',
      'isbn13': u'9780672322068',
      'issued': u'2001-10-12',
-     'name': u'Michael Urban; Brian Tiemann',
+     'name': u'Michael Urban|Brian Tiemann',
      'publisher': u'Sams',
      'title': u'FreeBSD Unleashed (With CD-ROM)'},
     {'edition': u'18., neu bearb. u. erw. Aufl',
@@ -1318,7 +1318,7 @@
     {'edition': u'1',
      'isbn13': u'9788534608954',
      'issued': u'1999-01-01',
-     'name': u'Anthony F. Iasi; Steven W. Griffith; Mark C. Chan',
+     'name': u'Anthony F. Iasi|Steven W. Griffith|Mark C. Chan',
      'publisher': None,
      'title': u'Java: 1001 Dicas de Programa\xe7\xe3o'},
     {'edition': u'02',
@@ -1330,7 +1330,7 @@
     {'edition': u'1',
      'isbn13': u'9781592003464',
      'issued': u'2004-05-28',
-     'name': u"Tom Igoe; Dan O'Sullivan",
+     'name': u"Tom Igoe|Dan O'Sullivan",
      'publisher': u'Course Technology PTR',
      'title': u'Physical Computing: Sensing and Controlling the Physical World with Computers'},
     {'edition': u'Reprint',
@@ -1348,13 +1348,13 @@
     {'edition': u'5th',
      'isbn13': u'9780933635869',
      'issued': u'1992-05-01',
-     'name': u'Sandy Petersen; Lynn Willis',
+     'name': u'Sandy Petersen|Lynn Willis',
      'publisher': u'Chaosium',
      'title': u'Call of Cthulhu'},
     {'edition': None,
      'isbn13': u'9780946819409',
      'issued': u'1993-10-01',
-     'name': u'Jeff Loader; Jennie Loader',
+     'name': u'Jeff Loader|Jennie Loader',
      'publisher': u'Sterling Pub Co Inc',
      'title': u'Making Board, Peg & Dice Games'},
     {'edition': u'2nd',
@@ -1366,7 +1366,7 @@
     {'edition': None,
      'isbn13': u'9781592570621',
      'issued': u'2003-07-01',
-     'name': u'Ronald O. Weingartner; Richard Levy',
+     'name': u'Ronald O. Weingartner|Richard Levy',
      'publisher': u'Alpha',
      'title': u"The Toy and Game Inventor's Handbook"},
     {'edition': None,
@@ -1390,13 +1390,13 @@
     {'edition': u'5',
      'isbn13': u'9780321335739',
      'issued': u'2000-01-01',
-     'name': u'OpenGL Architecture Review Board; Dave Shreiner; Mason Woo; Jackie Neider; Tom Davis',
+     'name': u'OpenGL Architecture Review Board|Dave Shreiner|Mason Woo|Jackie Neider|Tom Davis',
      'publisher': u'Addison-Wesley Professional',
      'title': u'OpenGL(R) Programming Guide: The Official Guide to Learning OpenGL(R), Version 2 (5th Edition)'},
     {'edition': u'Reprint',
      'isbn13': u'9780262632447',
      'issued': u'2001-10-01',
-     'name': u'John Maeda; Paola Antonelli',
+     'name': u'John Maeda|Paola Antonelli',
      'publisher': u'The MIT Press',
      'title': u'Design By Numbers'},
     {'edition': u'1ST',
@@ -1444,13 +1444,13 @@
     {'edition': u'1',
      'isbn13': u'9788576080817',
      'issued': u'2005-01-01',
-     'name': u'Gutmans; Bakken; Rethans',
+     'name': u'Gutmans|Bakken|Rethans',
      'publisher': u'Alta Books',
      'title': u'PHP 5: Programa\xe7\xe3o Poderosa'},
     {'edition': u'2',
      'isbn13': u'9780596007973',
      'issued': u'2000-01-01',
-     'name': u'Alex Martelli; David Ascher; Anna Ravenscroft',
+     'name': u'Alex Martelli|David Ascher|Anna Ravenscroft',
      'publisher': u"O'Reilly Media",
      'title': u'Python Cookbook'},
     {'edition': u'1',
@@ -1462,19 +1462,19 @@
     {'edition': None,
      'isbn13': u'9780131471498',
      'issued': u'2004-10-27',
-     'name': u'Andi Gutmans; Stig Bakken; Derick Rethans',
+     'name': u'Andi Gutmans|Stig Bakken|Derick Rethans',
      'publisher': u'Prentice Hall Ptr',
      'title': u'PHP 5 Power Programming (Bruce Perens Open Source)'},
     {'edition': None,
      'isbn13': u'9781904811824',
      'issued': u'2006-03-01',
-     'name': u'Cristian Darie; Bogdan Brinzarea; Filip Chereche&#351;-To&#351;a; Mihai Bucica',
+     'name': u'Cristian Darie|Bogdan Brinzarea|Mihai Bucica',
      'publisher': u'Packt Publishing',
      'title': u'Ajax And Php: Building Responsive Web Applications'},
     {'edition': u'1',
      'isbn13': u'9781565926813',
      'issued': u'2002-10-31',
-     'name': u'David Sklar; Adam Trachtenberg',
+     'name': u'David Sklar|Adam Trachtenberg',
      'publisher': u"O'Reilly Media",
      'title': u'PHP Cookbook'},
     {'edition': u'1',
@@ -1486,7 +1486,7 @@
     {'edition': u'1ST',
      'isbn13': u'9781565926103',
      'issued': u'2002-03-01',
-     'name': u'Rasmus Lerdorf; Kevin Tatroe',
+     'name': u'Rasmus Lerdorf|Kevin Tatroe',
      'publisher': u"O'Reilly Media",
      'title': u'Programming PHP'},
     {'edition': u'1',
@@ -1498,31 +1498,31 @@
     {'edition': None,
      'isbn13': u'9781590595091',
      'issued': u'2005-09-23',
-     'name': u'Lee Babin; Nathan A. Good; Frank M. Kromann; Jon Stephens',
+     'name': u'Lee Babin|Nathan A. Good|Frank M. Kromann|Jon Stephens',
      'publisher': u'Apress',
      'title': u'PHP 5 Recipes: A Problem-Solution Approach (Problem-Solution Approach)'},
     {'edition': u'4',
      'isbn13': u'9780596004828',
      'issued': u'2003-06-01',
-     'name': u'Ellen Siever; Aaron Weber; Stephen Figgins (editor)',
+     'name': u'Ellen Siever|Aaron Weber|Stephen Figgins (editor)',
      'publisher': u"O'Reilly",
      'title': u'Linux in a Nutshell, Fourth Edition'},
     {'edition': u'1ST',
      'isbn13': u'9780735708525',
      'issued': u'1999-12-20',
-     'name': u'Ed Petron; Laurie Petrycki',
+     'name': u'Ed Petron|Laurie Petrycki',
      'publisher': u'Sams',
      'title': u'Linux Essential Reference (Essential Reference Series)'},
     {'edition': u'2',
      'isbn13': u'9781565920019',
      'issued': u'1995-01-01',
-     'name': u"Daniel Gilly; The staff of O'Reilly Media",
+     'name': u"Daniel Gilly|The staff of O'Reilly Media",
      'publisher': u"O'Reilly",
      'title': u'Unix in a Nutshell: System V & Solaris 2.0'},
     {'edition': u'Reissue',
      'isbn13': u'9780140118131',
      'issued': u'1992-03-01',
-     'name': u'D. G. Wells; John Sharp (illustrator)',
+     'name': u'D. G. Wells|John Sharp (illustrator)',
      'publisher': u'Penguin Books',
      'title': u'The Penguin Dictionary of Curious and Interesting Geometry (Penguin Science)'},
     {'edition': None,
@@ -1540,7 +1540,7 @@
     {'edition': u'1',
      'isbn13': u'9780596006761',
      'issued': u'2004-01-01',
-     'name': u'Bruce Tate; Justin Gehtland',
+     'name': u'Bruce Tate|Justin Gehtland',
      'publisher': u"O'Reilly Media",
      'title': u'Better, Faster, Lighter Java'},
     {'edition': u'Spiral',
@@ -1564,19 +1564,19 @@
     {'edition': u'1',
      'isbn13': u'9788588745193',
      'issued': u'2002-01-01',
-     'name': u'Martina Brockmann; K. Kirchner; Sebastian Luhnsdorf; Et Al.',
+     'name': u'Martina Brockmann|K. Kirchner|Sebastian Luhnsdorf|Et Al.',
      'publisher': None,
      'title': u'Zope: Kit de Constru\xe7\xe3o de Aplicativos de Web'},
     {'edition': u'1ST',
      'isbn13': u'9780735711105',
      'issued': u'2001-12-12',
-     'name': u'Steve Spicklemire; Kevin Friedly; Jerry Spicklemire; Kim Brand',
+     'name': u'Steve Spicklemire|Kevin Friedly|Jerry Spicklemire|Kim Brand',
      'publisher': u'Sams',
      'title': u'Zope: Web Application Development and Content Management'},
     {'edition': u'1ST',
      'isbn13': u'9780735711372',
      'issued': u'2001-07-17',
-     'name': u'Amos Latteier; Michel Pelletier',
+     'name': u'Amos Latteier|Michel Pelletier',
      'publisher': u'Sams',
      'title': u'The Zope Book'},
     {'edition': u'1',
@@ -1612,7 +1612,7 @@
     {'edition': u'1',
      'isbn13': u'9781565924345',
      'issued': u'1999-08-01',
-     'name': u'Randy Jay Yarger; George Reese; Tim King',
+     'name': u'Randy Jay Yarger|George Reese|Tim King',
      'publisher': u"O'Reilly",
      'title': u'MySQL and mSQL'},
     {'edition': u'2nd',
@@ -1648,19 +1648,19 @@
     {'edition': u'1ST',
      'isbn13': u'9780201398298',
      'issued': u'2000-01-01',
-     'name': u'Ricardo Baeza-Yates; Berthier Ribeiro-Neto',
+     'name': u'Ricardo Baeza-Yates|Berthier Ribeiro-Neto',
      'publisher': u'Addison Wesley',
      'title': u'Modern Information Retrieval'},
     {'edition': u'2',
      'isbn13': u'9780471200246',
      'issued': u'2002-04-26',
-     'name': u'Ralph Kimball; Margy Ross',
+     'name': u'Ralph Kimball|Margy Ross',
      'publisher': u'Wiley',
      'title': u'The Data Warehouse Toolkit: The Complete Guide to Dimensional Modeling (Second Edition)'},
     {'edition': u'1',
      'isbn13': u'9780596002473',
      'issued': u'2002-03-15',
-     'name': u'Samuele Pedroni; Noel Rappin',
+     'name': u'Samuele Pedroni|Noel Rappin',
      'publisher': u"O'Reilly Media",
      'title': u"Jython Essentials (O'Reilly Scripting)"},
     {'edition': u'1ST',
@@ -1684,7 +1684,7 @@
     {'edition': None,
      'isbn13': u'9780971677500',
      'issued': u'2002-01-04',
-     'name': u'Allen Downey; Jeffrey Elkner; Chris Meyers',
+     'name': u'Allen Downey|Jeffrey Elkner|Chris Meyers',
      'publisher': u'Green Tea Pr',
      'title': u'How to Think Like a Computer Scientist: Learning with Python'},
     {'edition': u'2nd Rev',
@@ -1708,7 +1708,7 @@
     {'edition': u'Revised',
      'isbn13': u'9780609609712',
      'issued': u'2001-10-02',
-     'name': u'Larousse Gastronomique; Prosper Montagne (editor)',
+     'name': u'Larousse Gastronomique|Prosper Montagne (editor)',
      'publisher': u'Clarkson Potter',
      'title': u'Larousse Gastronomique'},
     {'edition': u'1',

Modified: Sandbox/luciano/kirbi/src/kirbi/demo/dump.py
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/demo/dump.py	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/demo/dump.py	2007-07-09 01:31:15 UTC (rev 77641)
@@ -41,10 +41,10 @@
             rec = books[book_id]
             role = record[7]
             if role == 'author':
-                rec['name'] += u'; ' +record[6].strip().decode('utf-8')
+                rec['name'] += u'|' +record[6].strip().decode('utf-8')
             else:
-                rec['name'] += u'; %s (%s)' % (record[6].strip().decode('utf-8'),
-                                               record[7].strip().decode('utf-8'))
+                rec['name'] += u'|%s (%s)' % (record[6].strip().decode('utf-8'),
+                                              record[7].strip().decode('utf-8'))
         else:        
             rec = {}
             for i, field in enumerate(book_fields):

Modified: Sandbox/luciano/kirbi/src/kirbi/demo/import.py
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/demo/import.py	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/demo/import.py	2007-07-09 01:31:15 UTC (rev 77641)
@@ -13,7 +13,7 @@
     srv = ServerProxy("http://localhost:8080/%s/pac" % instance)
     for book in collection:
         if book['name']:
-            book['creators'] = [creator.strip() for creator in book['name'].split(';')]
+            book['creators'] = [creator.strip() for creator in book['name'].split('|')]
             del book['name']
         for key in book.keys():
             if book[key] is None:

Modified: Sandbox/luciano/kirbi/src/kirbi/pac.py
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/pac.py	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/pac.py	2007-07-09 01:31:15 UTC (rev 77641)
@@ -28,22 +28,30 @@
             # XXX: if the query is empty, return all books; this should change
             # to some limited default search criteria or none at all
             results = self.context.values()
-            self.results_title = 'All %s books' % len(results)
+            self.results_title = 'All items'
         else:
             catalog = getUtility(ICatalog)
+            # Note: queries with a cr: prefix are creator queries
+            # XXX: this is not working: the book.creatorSet is never invoked
+            if query.startswith(u'cr:'):
+                query = query[3:].strip().lower()
+                set_query = {'any_of': [query]}
+                results = catalog.searchResults(creatorsSet=set_query)
+            else:
+                results = catalog.searchResults(searchableText=query)
             # Note: to sort the results, we must cast the result iterable
             # to a list, which can be very expensive
-            results = list(catalog.searchResults(title=query))
+            results = list(results)
             if len(results) == 0:
-                qty = 'No t'
-                s = 's'
+                qty = u'No i'
+                s = u's'
             elif len(results) == 1:
-                qty = 'T'
-                s = ''
+                qty = u'I'
+                s = u''
             else:
-                qty = '%s t' % len(results)
-                s = 's'
-            self.results_title = '%sitle%s matching "%s"' % (qty, s, query)
+                qty = u'%s i' % len(results)
+                s = u's'
+            self.results_title = u'%stem%s matching "%s"' % (qty, s, query)
 
         self.results = sorted(results, key=attrgetter('filing_title'))
         

Modified: Sandbox/luciano/kirbi/src/kirbi/pac_templates/index.pt
===================================================================
--- Sandbox/luciano/kirbi/src/kirbi/pac_templates/index.pt	2007-07-08 23:59:30 UTC (rev 77640)
+++ Sandbox/luciano/kirbi/src/kirbi/pac_templates/index.pt	2007-07-09 01:31:15 UTC (rev 77641)
@@ -3,9 +3,6 @@
     <title metal:fill-slot="title">
         Public Catalog
     </title>
-    <script metal:fill-slot="headers" type="text/javascript">
-        function setfocus() { document.forms[0].query.focus() }
-    </script>
 
 </head>
 <body>



More information about the Checkins mailing list