dabo Commit
Revision 5542
Date: 2009-12-02 10:23:31 -0800 (Wed, 02 Dec 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5542

Changed:
U   trunk/dabo/lib/datanav/Bizobj.py

Log:
Made BaseWhereClause property, as well as keeping the old getter style.


Diff:
Modified: trunk/dabo/lib/datanav/Bizobj.py
===================================================================
--- trunk/dabo/lib/datanav/Bizobj.py    2009-12-02 00:31:08 UTC (rev 5541)
+++ trunk/dabo/lib/datanav/Bizobj.py    2009-12-02 18:23:31 UTC (rev 5542)
@@ -1,6 +1,8 @@
 # -*- coding: utf-8 -*-
 import dabo.biz
+from dabo.dLocalize import _
 
+
 class Bizobj(dabo.biz.dBizobj):
        def getBaseWhereClause(self):
                """Subclasses can return a where clause stub that will always 
exist,
@@ -10,8 +12,13 @@
        
                Don't include the word "where": that'll be added automatically 
later.
                """
-               return ""
+               return getattr(self, "_baseWhereClause", "")
 
+
+       def _setBaseWhereClause(self, val):
+               self._baseWhereClause = val
+
+
        def addField(self, fld):
                try:
                        cursorInfo, alias = fld.split(" as ")
@@ -39,7 +46,7 @@
 
        BackendTableFields = property(_getBackendTableFields,
                        _setBackendTableFields, None, 
-                       """Contains information for properly filling out the 
where clause.
+                       _("""Contains information for properly filling out the 
where clause.
 
                        If you have the following base sql:
 
@@ -65,4 +72,8 @@
 
                                self.addField("invoice.number as invoicenumber")
                                self.addField("customer.name as name")
-                       """)
+                       """))
+
+       BaseWhereClause = property(getBaseWhereClause, _setBaseWhereClause, 
None,
+                       _("""A where-clause stub that will get prepended to 
whatever the user chooses."""))
+



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to