Hi,

We have a setup like below.  We would really like to hide the password and 
verify_password fields in the form based on some some conditions which will 
vary based on parameters set elsewhere (sometimes it's very confusing to 
show those fields).

The closest thing I could find is this post 
<https://groups.google.com/forum/#!searchin/turbogears/tw2.dynform%7Csort:date/turbogears/e9Lvs0FYUVE/YwoKjUmIwfgJ>,
 
which suggests "copying the dynamic field declaration inside the 
__field_widgets__ property" 

It would be very helpful to see an example, or any other suggestions would 
be very much appreciated.



class UserAdminConfig(UserControllerConfig):
    ...

    class defaultCrudRestController(ResourceManagerCrudRestController):
       ...
        __form_options__ = {
            '__require_fields__': ['user_name', 'email_address'],
            '__omit_fields__': ['_password', 'created', '_groups', 
'_reset_password_key',
                                'reset_password_key', 
'reset_password_expires'],
            '__hide_fields__': ['user_id'],
            '__field_order__': ['user_name', 'email_address', 
'display_name', 'groups',
                                'password', 'verify_password'],
            '__field_widget_types__': addopts(user_name=TextField,
                                              email_address=TextField,
                                              display_name=TextField),
            '__field_widget_args__': 
addopts(password=CUSTOM_FORM_FIELD_OPTIONS)
        }

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/turbogears/0d592ada-62b6-4467-93ab-5ca7f8a619a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to