[open-ils-commits] r904 - in servres/trunk/conifer: syrup templates (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 14 20:53:21 EDT 2010


Author: gfawcett
Date: 2010-07-14 20:53:20 -0400 (Wed, 14 Jul 2010)
New Revision: 904

Modified:
   servres/trunk/conifer/syrup/models.py
   servres/trunk/conifer/templates/master.xhtml
Log:
read app-title from 'application.title' config record

Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py	2010-07-15 00:53:11 UTC (rev 903)
+++ servres/trunk/conifer/syrup/models.py	2010-07-15 00:53:20 UTC (rev 904)
@@ -125,6 +125,14 @@
     name  = m.CharField(max_length=256)
     value = m.CharField(max_length=8192)
 
+    @classmethod
+    def get(cls, name, default=None, translator=lambda x: x):
+        try:
+            c = cls.objects.get(name=name)
+            return translator(c.value)
+        except cls.DoesNotExist:
+            return default
+
 #------------------------------------------------------------
 
 class ReadingList(BaseModel):

Modified: servres/trunk/conifer/templates/master.xhtml
===================================================================
--- servres/trunk/conifer/templates/master.xhtml	2010-07-15 00:53:11 UTC (rev 903)
+++ servres/trunk/conifer/templates/master.xhtml	2010-07-15 00:53:20 UTC (rev 904)
@@ -1,5 +1,5 @@
 <?python
-app_name = _('Syrup Reserves System')
+app_name = models.Config.get('application.title', _('Syrup Reserves System'))
 search = _('search...')
 import os
 ?>



More information about the open-ils-commits mailing list