[Grok-dev] Using zc.sourcefactory.basic.BasicSourceFactory for a schema.List

Thibaud Morel l'Horset teebes at gmail.com
Thu Apr 30 20:47:22 EDT 2009


Thanks a lot, that worked. I added this use-case as a comment to the how-to
on the doc site.

On Thu, Apr 30, 2009 at 6:45 PM, Douglas Cerna <douglascerna at yahoo.com>wrote:

>
> Have you tried something like this:
>
> class IFoo(Interface):
>
>    foos = schema.List(
>        title=u"Foos",
>        value_type=schema.Choice(title=u"Foo", source=YourSource())
>        )
>
>
> This specifies that the "foos" attribute will be a list that only can
> contain values retrieved from the source.
>
> Hope this helps.
>
> Douglas
>
> "... allí­ es cuando te das cuenta que las cosas malas pueden resultar
> bastante buenas..." - Lionel Messi
>
> Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
> Vea http://www.gnu.org/philosophy/no-word-attachments.es.html
>
>
> --- On Thu, 4/30/09, Thibaud Morel l'Horset <teebes at gmail.com> wrote:
>
> > From: Thibaud Morel l'Horset <teebes at gmail.com>
> > Subject: [Grok-dev] Using zc.sourcefactory.basic.BasicSourceFactory for a
> schema.List
> > To: "Grok" <grok-dev at zope.org>
> > Date: Thursday, April 30, 2009, 1:28 PM
> > Is there a way to specify a source to a schema.List?
> >
> > I went through the form source tutorial at
> > http://grok.zope.org/documentation/how-to/using-sources-in-your-forms
> > but
> > while that works great for schema.Choice, I get the
> > following error when
> > trying to use it with a List:
> >
> > ZopeXMLConfigurationError: File
> > "/Users/thibaud/grok/scs/src/scs/configure.zcml",
> > line 5.2-5.27
> >     TypeError: __init__() got an unexpected keyword
> > argument 'source'
> >
> > Is there no way to do this?
> >
> > Thanks,
> >
> > Thibaud
> > _______________________________________________
> > 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/20090430/443de4e4/attachment.html 


More information about the Grok-dev mailing list