read app-title from 'application.title' config record
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 15 Jul 2010 00:53:20 +0000 (00:53 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 15 Jul 2010 00:53:20 +0000 (00:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@904 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/syrup/models.py
conifer/templates/master.xhtml

index 7028328..10dae4c 100644 (file)
@@ -125,6 +125,14 @@ class Config(m.Model):
     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):
index 5d1614e..b35580d 100644 (file)
@@ -1,5 +1,5 @@
 <?python
-app_name = _('Syrup Reserves System')
+app_name = models.Config.get('application.title', _('Syrup Reserves System'))
 search = _('search...')
 import os
 ?>