Bummer ;-)

I don't think I have a developed an application in the last 10 years
that hasn't has to do this.
I was quite surprised when I discovered this feature was missing in
formish, but it seems to be missing in quite a
few other form libs like wtforms as well.

I suppose at least they all have declarative method of defining the
schema, but it does mean the actual schema definition is a bit more



On Tue, Sep 7, 2010 at 8:20 PM, Chris McDonough <chr...@plope.com> wrote:
> Hi Tim,
> Sorry, there is no built-in solution that will allow you to use
> declarative-module-scope code only.  You'll need to generate schemas and
> widgets at render time.
> - C
> On Tue, 2010-09-07 at 12:56 +0800, Tim Hoffman wrote:
>> Hi Chris.
>> Am just starting too look at deform in some detail and I have question.
>> One of the things I have struggled with formish has been the fact I
>> can't easily
>> define a source of values for widgets like checkbox or validators such
>> as OneOf to
>> only be resolved late at render time. And I can't see how I would go
>> about it with deform.
>> In your example http://docs.repoze.org/deform/app.html you have
>>  colors = (('red', 'Red'), ('green', 'Green'), ('blue', 'Blue')) used
>> as values for
>> widget.RadioChoiceWidget values and for the validator OneOf
>> So in my contrived example I would like the set of possible values
>> for color is dependent on the
>> user and some other factor.  Looking at the code for SelectWidget and
>> RadioChoice widget
>> it appears they won't take a callable and lazily render those values
>> at render time.
>> With formish I basically constructed the form structure (schema)
>> but only applied widget definitions  and validators just before render
>> time. So that I could use things
>> like the current context to determine values for validation or
>> choices.  This was a bit of a hack.
>> So do you have a strategy or suggestion on how to approach this use case ?
>> I suppose I could work with imperative schema definition performed
>> late, but I much prefer to work with classes.
>> (I currently generate Formish (structures) directly from UML).
>> Cheers
>> Tim
>> _______________________________________________
>> Repoze-dev mailing list
>> Repoze-dev@lists.repoze.org
>> http://lists.repoze.org/listinfo/repoze-dev
Repoze-dev mailing list

Reply via email to