On Jul 22, 2010, at 11:30 PM, Monte Milanuk wrote:
>> Can you paste your createBizobjs() code here? Perhaps there is a typo
>> there, which is the most common reason for this.
>
> Sure... but FWIW, the tutorial has me trying to run the form as 'a quick
> visual testing' before it gets into editing creatBizobj. Given the
> pictured form in the document, one would get the impression that the
> form should at least display at this point, unless I went astray
> somewhere else?
I think what's going on here is that when the application started up,
it didn't find anything in the 'biz' directory, so there was nothing to import;
hence, 'self.Application.biz' was None, instead of a module reference. The
reason for that is that Dabo does a lot of "magic" stuff when it starts up to
get all those references into handy namespaces for you, but there is no good
way to update them while the app is running. If you launch the Class Designer
now, do you still get that error? If so, open a Command Window (ctrl-d), and
type 'self.Application.biz', then press Enter. It should either print a module
reference, or nothing. If it's nothing, then it seems that something is not
quite right at startup.
> def createBizobjs(self):
> hoursBizobj = self.Application.biz.HoursBizobj(self.Connection)
> self.addBizobj(hoursBizobj)
>
> self.requery()
>
> (The last line added from the first part of 'Connecting the Bizobjs' in
> the Pycon tutorial.)
The 'self.requery()' line really should be in the afterInit() method of
the form. It probably doesn't make a huge difference, but you generally want to
make sure that the form is fully instantiated before you call methods that
might affect it.
-- Ed Leafe
_______________________________________________
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]