On Wednesday 14 July 2010 10:45:13 am Paul McNett wrote:
> On 7/14/10 9:56 AM, John wrote:
> > I'd like to use several of the dabo.lib functions in an 'expr' for a
> > report. But is appears that the dabo functions are not available. I get
> > an error "name 'dabo' is not defined"
> >
> > How do I get reportwriter to see the dabo functions or any function for
> > that matter?
>
> I've been meaning to add an 'imports' section in the rfxml, where you can
> specify the modules to import and refer to from various places in the
> report.
>
> The only reason references to datetime and Decimal work is because they are
> imported at the top of dabo/lib/reportWriter.py.
>
> One thing you can do until I get a better method in place is to import the
> module into a variable:
>
> 40 <Variable>
> 41 <expr>self.dabo</expr>
> 42 <initialValue>__import__("dabo")</initialValue>
> 43 <name>dabo</name>
> 44 <resetAt>None</resetAt>
> 45 </Variable>
>
> And then refer to it, e.g.:
>
> 659 <String>
> 660 <expr>self.dabo.lib.getRandomUUID()</expr>
> 661 <x>0</x>
> 662 <y>0</y>
> 663 <width>100</width>
> 664 </String>
>
> Paul
I like this. However, the reportwriter was subclassed and I was able to just
add a method. Thanks
Johnf
_______________________________________________
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]