dabo Commit
Revision 5540
Date: 2009-12-01 16:30:15 -0800 (Tue, 01 Dec 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5540

Changed:
U   trunk/dabo/ui/uiwx/dDateTextBox.py

Log:
I'm starting to use dDateTextBox more, and I just ran into a situation where I
create a dialog and add a dDateTextBox with a DataSource and DataField, and 
when it instantiates it flushes None to the already set date value in the
biz. This fixes it and doesn't cause any other issues I can find.


Diff:
Modified: trunk/dabo/ui/uiwx/dDateTextBox.py
===================================================================
--- trunk/dabo/ui/uiwx/dDateTextBox.py  2009-12-01 17:13:45 UTC (rev 5539)
+++ trunk/dabo/ui/uiwx/dDateTextBox.py  2009-12-02 00:30:15 UTC (rev 5540)
@@ -65,7 +65,6 @@
        def _beforeInit(self, *args, **kwargs):
                self._baseClass = dDateTextBox
                self._calendarPanel = None
-               self.Value = None
                # Two-digit year value that is the cutoff in interpreting 
                # dates as being either 19xx or 20xx.
                self.rollover = 50
@@ -87,6 +86,10 @@
        
        def _afterInit(self):
                #self.Value = datetime.date.today()  ## no, don't set default, 
it could override val. in db.
+               if not self.Value:
+                       self.update()  ## First try to get it from the db
+               if not self.Value and self.Value is not None:
+                       self.Value = None  ## If it is still blank, default to 
None so the control works correctly
                if self.showCalButton:
                        # Create a button that will display the calendar
                        self.calButton = dButton(self.Parent, 
Size=(self.Height, self.Height),



_______________________________________________
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