--- MPIWGWeb/MPIWGProjects.py 2006/09/14 18:28:27 1.47.2.60 +++ MPIWGWeb/MPIWGProjects.py 2006/10/27 18:37:20 1.47.2.62 @@ -33,7 +33,6 @@ from Ft.Xml.XPath import Evaluate from Ft.Xml.XPath.Context import Context from Ft.Xml.Domlette import NonvalidatingReader,PrettyPrint, Print from Ft.Xml import EMPTY_NAMESPACE -import psycopg definedFields=['WEB_title','xdata_01','xdata_02','xdata_03','xdata_04','xdata_05','xdata_06','xdata_07','xdata_08','xdata_09','xdata_10','xdata_11','xdata_12','xdata_13','WEB_project_header','WEB_project_description','WEB_related_pub'] @@ -454,6 +453,26 @@ class MPIWGRoot(ZSQLExtendFolder): return True return False + def getSection(self): + """returns the current section name""" + root = self.absolute_url() + url = self.REQUEST['URL'] + path = string.replace(url, root, '') + paths = path.split('/') + if len(paths) > 0: + return paths[1] + return None + + def getSectionStyle(self, name, style=""): + """returns a string with the given style + '-sel' if the current section == name""" + if self.getSection() == name: + return style + '-sel' + else: + return style + + def MPIWGrootURL(self): + """returns the URL to the root""" + return self.absolute_url() def upDateSQL(self,fileName): """updates SQL databases using fm.jar""" @@ -1450,6 +1469,7 @@ class MPIWGRoot(ZSQLExtendFolder): def generateNameIndex(self): """erzeuge einen index verwendeter personen""" + import psycopg o = psycopg.connect('dbname=authorities user=dwinter password=3333',serialize=0) results={} print self.fulltext.historicalNames.items()