Użytkownik Adrian Klaver napisał:
>> For empty string date, convertStringValueToDataType() method return Null
>> value,
>> but in such situation ValueError exception is raised.
>> My proposal changes this behaviour so it would be possible.
>> For e.g., instead code:
>>       if retVal is None:
>> there should be:
>>       if retVal is None and not self.AllowNullDates:
>>      
>
> Now you are asking for something different. Empty string is not Null. In any
> case it is covered. To follow you need to look at:
> def _getValue(self)
>
> I have tried it here and can set the Value to either a string or Null. The 
> only
> issue is if I try to save it back to Postgres then the db will not accept an
> empty string as a date value.
>    

Dear Adrian, current state of behaviour of dDateTextBox is unacceptable 
for me.
Except issue with double click I put on Trac, lets try another:
- initial value of DataField is None
- so control Value is None too
- set focus on and clear value - set to empty string, and confirm with 
Enter,
     then you receive in log "Non-date value in txtEffectiveDate: '' is 
type '<type 'unicode'>'"
- next, you will be unable to set proper date at all for that control,
     you always receive error mentioned above, even if you write whole
     date manually, e.g. "2010-01-01" - is invalid date too.

Although my proposal doesn't handle above issue,
it handles Null date - all empty strings are treated as Null dates
and are handled by backend correctly (until you set "NOT NULL" of course).
I tested this change.
Besides, I created wx.DatePickerCtrl based control that handles dates 
even better.
When I finish to caress my code I'll publish it here.

-- 
Regards
Jacek Kałucki

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

Reply via email to