Add getSingleton() method to return the Site settings entity.
There is always only one Site entity, referred to by DEF_SITE_LINK_ID.
Patch by: Todd Larsen
Review by: to-be-reviewed
--- a/app/soc/logic/models/site.py Tue Jan 20 21:37:30 2009 +0000
+++ b/app/soc/logic/models/site.py Tue Jan 20 21:48:28 2009 +0000
@@ -74,5 +74,10 @@
return ['link_id']
+ def getSingleton(self):
+ """Return singleton Site settings entity, since there is always only one.
+ """
+ return self.getFromFields(link_id=self.DEF_SITE_LINK_ID)
+
logic = Logic()