- Where is misc_/sample/item?
In the sample product, Product.py defines # Specify a relative URL for the icon used to display icons: icon='misc_/sample/item' In the MailHost product, MailHost.py defines icon='misc_/MailHost/MHIcon' Where are these things located? I couldn't find a directory named "misc_" anywhere, nor could I figure out how to get at any such beasts from within the management interface. thx, Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/ skip@calendar.com | Musi-Cal: http://concerts.calendar.com/ 518-372-5583
skip@calendar.com writes:
In the sample product, Product.py defines
# Specify a relative URL for the icon used to display icons: icon='misc_/sample/item' In the MailHost product, MailHost.py defines icon='misc_/MailHost/MHIcon' Where are these things located? I couldn't find a directory named "misc_" anywhere, nor could I figure out how to get at any such beasts from within the management interface.
In the __init__.py for the MailHost product, a misc_ dictionary is defined, and one key maps 'MHIcon' to an ImageFile object. I'm not sure why it's done through a dictionary like this; why not just do icon = ImageFile(...) and point to just "icon"? -- A.M. Kuchling http://starship.skyport.net/crew/amk/ "Well, at least you've got the element of surprise on your side." "That would not be honorable, Matthew. I have already sent a messenger to the Lord of Hell, to let him know that I will be coming. One must do these things properly." -- From SANDMAN: "Season of Mists", episode 1
Andrew> In the __init__.py for the MailHost product, a misc_ dictionary Andrew> is defined, and one key maps 'MHIcon' to an ImageFile object. Andrew> I'm not sure why it's done through a dictionary like this; why Andrew> not just do icon = ImageFile(...) and point to just "icon"? Thanks for the correction. I wonder about all the extra traversal as well. Seems to complicate the implementation. Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/ skip@calendar.com | Musi-Cal: http://concerts.calendar.com/ 518-372-5583
skip@calendar.com wrote:
In the sample product, Product.py defines
# Specify a relative URL for the icon used to display icons: icon='misc_/sample/item'
In the MailHost product, MailHost.py defines
icon='misc_/MailHost/MHIcon'
Where are these things located? I couldn't find a directory named "misc_" anywhere, nor could I figure out how to get at any such beasts from within the management interface.
Zope defined a sub-object of the top-level object, misc_, which has a sub-object for each product. Each product sub-object has subobjects for each of the keys defined in the misc_ dictionary in the product __init__.py. This provides a mechanism for creating product-dependent instance-independent objects that are web accessable. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (540) 371-6909 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (3)
-
Andrew M. Kuchling -
Jim Fulton -
skip@calendar.com