[Grok-dev] autoforms and derived interfaces
Souheil CHELFOUH
trollfot at gmail.com
Wed Jun 24 06:18:49 EDT 2009
This is maybe a bit off subject, but I dealt with this form/content/fields
matters in a package :
http://tracker.trollfot.org/browser/projects/dolmen/dolmen.packages/dolmen.content/dolmen/content
If you want to have a look, maybe we can share opinions and fiddle something
more interesting for both of us :)
2009/6/23 Jasper Spaans <j at jasper.es>
> Hi,
>
> The following code should speak for itself; is it supposed to work like
> this? (the reason for the constructor is that form_fields takes its value
> from IAction, which is not what I want as I'm adding/editting objects of
> type context.__class__, which might implement interfaces derived from
> IAction.)
>
> trollfot on #grok mentioned that a use case for the current behaviour is
> when you want to prevent editing all of the attributes of an object.
>
> What's your opinion?
>
> class EditAction(grok.EditForm):
> grok.name('edit')
> grok.context(IAction)
> grok.template('addaction')
>
> def __init__(self, context, request):
> super(EditAction, self).__init__(context, request)
> self.form_fields = grok.AutoFields(context.__class__)
>
> Cheers,
> --
> Jasper Spaans
>
> Fox-IT Experts in IT Security!
> I www.fox-it.com
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20090624/36e705ef/attachment.html
More information about the Grok-dev
mailing list