Paul,

On 02/02/2011 17:51, Paul McNett wrote:
> On 2/2/11 4:01 AM, Werner F. Bruhin wrote:
>> I am trying out the AppWizzard and ideally I would like the generated
>> forms etc for the "Master data" editing, however I would like to change
>> some things.
> The AppWizard generates source .py files that you are free to edit as you see 
> fit. In
> fact, you are encouraged to do so!
>
> While much of the generated code contains classes that descend from the 
> datanav
> sub-framework, and much of the behavior is kind of hard-coded in datanav, 
> there are a
> lot of tweakable things and you could also bi-pass datanav completely for 
> some or all
> forms.
>
>> 1.  use dDragForm instead of dFrom
> Um, what's dDragForm?
Oops, I ment dDockForm also know as wx.AUI:)  BTW, what were the reasons 
to go with wx.AUI over wx.agw.aui?

Or have an alternative(s) datanav's, i.e. have different ones and at the 
appropriate moment the AppWizard asks which one to use - kind of like 
having different templates.
>>        - selection at the bottom or top and the search and edit page as a
>> notebook at the bottom
> You should design your own form how you want it, but you could still use the
> generated biz and grid classes...
Which I need to do for each table, hoped to figure out a way to automate 
it a bit.
>> 2. define for each field a translatable description, HelpText and
>> ToolTip which are reused whenever I use that field from that particular
>> bizObj
> I do this a lot in my code. Make getToolTipText() and getHelpText() methods 
> in your
> bizobj, that take as an arg the name of the field. Then instantiate your 
> controls at
> the form level like:
>
> biz = self.getBizobj(datasource)
> txt = dabo.ui.dTextBox(self, DataSource=datasource, DataField=field,
>                          ToolTipText=biz.getToolTipText(),
>                          HelpText=biz.getHelpText())
>
I get the concept but don't see how this works, i.e. how is above 
passing "field" to getToolTipText, is there some magic in biz?

I assume in the bizobj I have a dict with field as the key and the texts 
as values, e.g.:

{'name': [_('Country name'), _('tooltip for Country name'), _('helptext 
for Country name')]}

>> 3. define a default field order per bizObj
> Do this by rearranging the DataStructure tuple in your biz definition. 
> AppWizard puts
> the fields in the order that it finds them in the database. Would be nice to 
> enhance
> AppWizard to remove specified fields and allow for rearrangement at that 
> level, but
> the key thing to remember is that AppWizard is meant to help you get started 
> with
> runnable code. That code is there for you to modify to your desire.
>
I tried that but it seems to be ignored.  Will try again, maybe by that 
time I already played around with the grid (moved columns around) and 
the user settings were overriding my source code change.

>> 4. disallow deletion on some bizObj
> In the particular bizobj definition, add a beforeDelete() method that returns
> "Deletion not allowed", or whatever string you want the user to see. If you 
> don't
> want the user to see any message, override biz.delete() and biz.deleteAll()
> completely, like:
>
> class MyBiz(dabo.biz.dBizobj):
>     def delete(self): pass
>     def deleteAll(self): pass
>
>
Thanks for your tips.
Werner

_______________________________________________
Post Messages to: Dabo-users@leafe.com
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/4d499daf.2020...@free.fr

Reply via email to