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?

>       - 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...

> 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())


> 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.

> 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


Paul
_______________________________________________
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