Jorge Godoy wrote:
> Christoph Zwerschke escreveu:
>> But unfortunately, AutoCompleteField is a CompoundWidget, so it returns
>> a dictionary with two values. I.e. my validator does not fit any more,
>> my label does not fit any more (the id is different), and the data I get
>> back is now a dictionary with two values instead of a string.
> 
> It wasn't like that before, but then it changed so that you can have quicker 
> access to the index of the information you are working with.
> 
>> So I need to rewrite everything just to change a TextField to a
>> AutoCompleteField? Do I miss anything? This seems to be completely
>> awkward to me. I thought TurboGears should be easier.
> 
> Unfortunately yes.  You have to.  This is one price to pay.  You can also 
> change the implementation of the AutoCompleteField and remove this.  It isn't 
> hard to do (and you can even get code from the subversion repository prior to 
> that change, something like 14 or 15 months ago, IIRC).

Ok, though I still not fully understand the use of this. It would have 
been better to make this a separate widget or controlled by a parameter, 
so you can replace a TextField with an AutoCompleteField and have this 
additional functionality only when you really want it. If there are 
other people who agree with me, I'll create a patch for this. Otherwise 
I will just make my private AutoCompleteField.

>> ... Is this solved differently in ToscaWidgets?
> 
> No.  Both use the same basis: FormEncode.  This is how FormEncode works.

Ah, right. I forgot about that. Somehow I cannot really make friends 
with FormEncode. It's both the nesting and I'm sometimes also confused 
about the direction and order of evaluation (from_python, to_python and 
compound validators) - it's often the opposite of what I expect ;-)
Maybe it's because I haven't used it much and never systematically read 
the documentation, though.

-- Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to