The nightmare begins...

So I am taking a look at what the app wiz generated.  I am bummed that there is 
generic code in the 'instance layer'.  like FrmEvents.py, pasted below.

Until I get comphy, I will start by posting here and once something passes some 
thing feel free to tell me to post it somewhere else, like the bug tracking 
thing that I wasn't able to log into.

onto the meat:

1. A header would be nice, like the file name.  where do you want me to post 
that request?

2. Why all the imports?  FrmBase seems to be the only one needed, and I am not 
sure I see why you are doing 'from' and not just 'import.'  wouldn't it be 
better to do:

import FrmBase
class FrmEvents(FrmBase.FrmBase):

So that there isn't an extra.. um.. something ?

3. self.super() - I thought the x_pre()/x()/x_post() pattern kept you from 
having to run the code in the super class because there was none?

4. self.NameBase = "frmEvents", self.Caption = "Events"...  shouldn't these 
things be in an xml file?

5. afterInit(self) is just one big constant wrapped around "Events", right?  so 
why isn't the code in an abstract class that reads "Events" from an attribute ?

Carl K


# -*- coding: utf-8 -*-

import os
from FrmBase import FrmBase
from GrdEvents import GrdEvents
from PagSelectEvents import PagSelectEvents
from PagEditEvents import PagEditEvents


class FrmEvents(FrmBase):

        def initProperties(self):
                self.super()
                self.NameBase = "frmEvents"
                self.Caption = "Events"
                self.SelectPageClass = PagSelectEvents
                self.BrowseGridClass = GrdEvents
                self.EditPageClass = PagEditEvents


        def afterInit(self):
                self.super()

                # Instantiate the bizobj:
                app = self.Application
                primaryBizobj = app.biz.Events(app.dbConnection)
                

                # Register it with dForm:
                self.addBizobj(primaryBizobj)
                
                # The form now knows what it needs to create itself. Do it!
                self.creation()

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to