Using an extension in a detector
Tom Ekberg <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <SN6PR08MB478462BA54ADFE1FB9364270CAF90@SN6PR08MB4784.namprd08.prod.outlook.com> |
I wrote simple function in an extension that I normally use in files like html/page.html. I'd also like to call that function in a detector. The error I get is that the utils package isn't defined. I also tried 'import utils' but it didn't work either. Removing the package from the function call also didn't work.
The extension file contains:
def user_in_group(db, group):
return sorted([str(u.username) for u in db['user'].list() if group in str(u.organisation).split(',')])
def init(instance):
instance.registerUtil('user_in_group', user_in_group)
The reference in a detector is:
nosy_people = utils.user_in_group(db, 'nosy')
What import do I need to be able to call an extension function from a detector?
Tom Ekberg
Senior Computer Specialist, Lab Medicine
4th Floor, Pat Steel Building
Department of Laboratory Medicine
Work: (206) 520-4856
Email: [email protected]
_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users