Paul McNett wrote:
> On 9/13/10 12:59 PM, Jim Byrnes wrote:
>> Ed Leafe wrote:
>>> On Sep 13, 2010, at 2:49 PM, Jim Byrnes wrote:
>>>
>>>> If I run: self.UserSQL = """select * from items where done is
>>>> Null"""
>>>>
>>>> The 'done' column cells show<None>.
>>>>
>>>> Is there a way to just leave them blank?
>>>
>>> Sure: set the NoneDisplay property. It exists at the dApp level,
>>> which will affect how *all* None values are displayed in your app.
>>> You can override that at the individual grid or textbox level by
>>> setting the NoneDisplay property of those controls.
>>>
>>
>> Right, I did look before I asked? Must have been fixated on Null.
>
> I think you'll find that you'll want to discriminate between fields that have 
> no
> defined value (None) and fields that have "" as their value.

I wondered about that once I realized how NoneDispaly worked.  I did 
some testing and found a seldom encountered case where it would make a 
difference.  I think I will make some changes so that there will be no 
Nulls to worry about. Something I need to keep in mind for the future.

> I'd leave some sort of non-blank NoneDisplay for the general case, and set a
> VirtualField in the Bizobj for the read-only display value of the field which 
> you can
> use in grid columns or other read-only contexts. For example:
>
> class MyBiz(dabo.biz.dBizobj):
>     def initProperties(self):
>       ...
>       self.VirtualFields["display_item_description"] = 
> self.getDisplayItemDescription
>       ...
>
>     def getDisplayItemDescription(self):
>       v = self.Record.item_description
>       if not v:
>         return ""
>       # perhaps other processing for other reasons here
>       return v
>
> Paul

I haven't had a chance to look at Virtual fields yet.  Thanks for the 
example, it should make them easier to understand if I ever need to use 
them.

Thanks,  Jim
_______________________________________________
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