Thanks a lot, that worked. I added this use-case as a comment to the how-to on the doc site.<br><br><div class="gmail_quote">On Thu, Apr 30, 2009 at 6:45 PM, Douglas Cerna <span dir="ltr">&lt;<a href="mailto:douglascerna@yahoo.com">douglascerna@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Have you tried something like this:<br>
<br>
class IFoo(Interface):<br>
<br>
    foos = schema.List(<br>
        title=u&quot;Foos&quot;,<br>
        value_type=schema.Choice(title=u&quot;Foo&quot;, source=YourSource())<br>
        )<br>
<br>
<br>
This specifies that the &quot;foos&quot; attribute will be a list that only can contain values retrieved from the source.<br>
<br>
Hope this helps.<br>
<br>
Douglas<br>
<br>
&quot;... allí­ es cuando te das cuenta que las cosas malas pueden resultar bastante buenas...&quot; - Lionel Messi<br>
<br>
Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.<br>
Vea <a href="http://www.gnu.org/philosophy/no-word-attachments.es.html" target="_blank">http://www.gnu.org/philosophy/no-word-attachments.es.html</a><br>
<br>
<br>
--- On Thu, 4/30/09, Thibaud Morel l&#39;Horset &lt;<a href="mailto:teebes@gmail.com">teebes@gmail.com</a>&gt; wrote:<br>
<br>
&gt; From: Thibaud Morel l&#39;Horset &lt;<a href="mailto:teebes@gmail.com">teebes@gmail.com</a>&gt;<br>
&gt; Subject: [Grok-dev] Using zc.sourcefactory.basic.BasicSourceFactory for a schema.List<br>
&gt; To: &quot;Grok&quot; &lt;<a href="mailto:grok-dev@zope.org">grok-dev@zope.org</a>&gt;<br>
&gt; Date: Thursday, April 30, 2009, 1:28 PM<br>
<div><div></div><div class="h5">&gt; Is there a way to specify a source to a schema.List?<br>
&gt;<br>
&gt; I went through the form source tutorial at<br>
&gt; <a href="http://grok.zope.org/documentation/how-to/using-sources-in-your-forms" target="_blank">http://grok.zope.org/documentation/how-to/using-sources-in-your-forms</a><br>
&gt; but<br>
&gt; while that works great for schema.Choice, I get the<br>
&gt; following error when<br>
&gt; trying to use it with a List:<br>
&gt;<br>
&gt; ZopeXMLConfigurationError: File<br>
&gt; &quot;/Users/thibaud/grok/scs/src/scs/configure.zcml&quot;,<br>
&gt; line 5.2-5.27<br>
&gt;     TypeError: __init__() got an unexpected keyword<br>
&gt; argument &#39;source&#39;<br>
&gt;<br>
&gt; Is there no way to do this?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Thibaud<br>
</div></div>&gt; _______________________________________________<br>
&gt; Grok-dev mailing list<br>
&gt; <a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
&gt; <a href="http://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">http://mail.zope.org/mailman/listinfo/grok-dev</a><br>
<br>
<br>
<br>
<br>
</blockquote></div><br>