[Grok-dev] Adding a image to form_fields

Jan Ulrich Hasecke janulrich.hasecke at web.de
Wed Aug 29 14:47:36 EDT 2007


Hi Grokkers,

I want to add images to my animal objects in our zoo game. I want to  
access them in page templates via "context.icon" eg. or any other  
better method.

The images reside in static.

How do I add them?

I have an animal class and want to make subclasses for each breed.  
When an animal of a selected breed is added the predefined image  
shall be assigned to the object. But how?

In the Addform? Or in the class/subclass itself?

And what do I have to define in form_fields?

form_fields = grok.Fields(
	name=TextLine(title=u"Name"),
	age=Int(title=u"Alter"),
	price=Int(title=u"Preis"))
	image=…

Would that be image=URI(…)?

TIA
juh

-- 
www.sudelbuch.de
Satiren und Essays


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Signierter Teil der Nachricht
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20070829/ab4ec319/PGP.bin


More information about the Grok-dev mailing list