[Grok-dev] progress on megrok.form

Uli Fouquet uli at gnufix.de
Wed Apr 29 07:55:35 EDT 2009

Hi there,

@Santiago: thanks for the work!

Souheil CHELFOUH wrote:

> 2009/4/29 Santiago Videla <santiago.videla at gmail.com>:
> > 1. megrok.form depends on zc.datetimewidget and the last depends on
> > zc.resourcelibrary. Using hurry.* to tinymce inclusion, there is a conflict
> > between hurry.zoperesource and zc.resourcelibrary. I'm not sure what to do
> > with this. Should I copy all the widgets, javascript, css,... into
> > megrok.form in order to use hurry.* ?
> 1. I've used megrok.resourcelibrary, for that matter

That won't help here, I'm afraid, as megrok.resourcelibrary pulls in
zc.resourcelibrary. zc.resourcelibrary and hurry.resource (included by
hurry.zoperesource) have conflicting ZCML registrations. Also widgets
have to need() their JavaScript stuff with the appropriate resource lib.

In general this means (at least I think so): you have to use
hurry.resource _or_ zc.resourcelibrary, not both. As hurry.tinymce
requires hurry.resource and zc.datetimewidget relies on
zc.resourcelibrary, we have a problem here.

So the only way I'd see, would indeed be (as Santiago already supposed)
to copy the stuff from zc.datetimewidget over and make different
registrations of the JavaScript stuff with hurry.resource.

I'll cite Martijn from a posting where we discussed that very problem

Martijn wrote:

> You will
> then need to make sure that the DateTimeWidget uses a
> hurry.resource-style .need() declaration
> for its javascript as well. To that end you'll need to create a
> resource.Library and resource.ResourceInclude for that Javascript.

It might also be sufficient to require zc.datetimewidget in setup.py,
provide an own widget implementation in megrok.form which basically
works like the original one, but uses hurry.resource as explained by

But afterwards you will most probably run into configuration problems,
as all the zc.datetimewidget ZCML registrations have to be done in
megrok.form, except those, that do something with zc.resourcelibrary.
Also this is manageable, but I am not sure, what happens when a
grokproject requires `megrok.form` and uses ``includeDependencies``
statement. Chances are, that then the zc.resourcelibrary ZCML will be
parsed and everything breaks.

Maybe it is quicker, safer and more transparent to copy all stuff from
zc.datetimewidget over and adapt it to hurry.resource.

Another approach would be to simply skip DateTimeWidget from the
supported widgets or to create a datetimewidget based on hurry.yui.

I am a bit concerned about this dependency problems, right now, as it
means, that you cannot use megrok.form together with any
zc.resourcelibrary-dependent package (including megrok.resource,
zc.datetimewidget and probably many others). 

Is there a way to circumvent this problem?


Best regards,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20090429/4b993f47/attachment.bin 

More information about the Grok-dev mailing list