[EMAIL PROTECTED] wrote:
> mmh ? yeah this is what I usually do. But this time I was wanting to
> disable a field. And I've been doing it with :
>
> add_people_form.field_for('lastname').attrs['disabled']='true'
>
> in the controllers.py without knowing if its a good way to do it like
> this ?
>
I don't know. I'd rather give the attrs via a form-wide **param, so I
can group them together, or with other widget parameters.
Keep in mind that form_attrs is for the container widget, and attrs for
the children.
I've not used ToscaWidgets yet, but it will have a much cleaner API for
widget containment. I look forward to it.
>> There are many ways to operate forms, widgets, validators... it boils
>> down to (meta)classes and passing of dictionaries... so the best thing
>> would be to understand the base concepts. Try writing a few forms, then
>> take a look to widgets/forms.py to understand more of it.
>>
> I've been browsing this ! But it's quite hard to get it !
>
Yes, I know.
I've started a nice complex business app and the official documentation
does not cover many of my use cases.
Sure it's enough to get started, but from time to time I find new
patterns.. and it can be tricky to understand the pros and cons of each one.
The best thing is that the framework is so flexible that I can usually
have things done in a quick (if dirty) way and refactor later when I
know better.
My opinion is that TG applications, when "done right", can scale up in
complexity and size. But TG also scales down to a single programmer in a
hurry, so the balance requires some insight.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---