Hi, I'm trying to create a interface for the User model, with the
aggregate of the user_surname field.
The problem I'm having is with the update interface. I already did the
create one, and I wish to re-use it for the Update interface.

The thing is that I cant populate the TextFields of the Form.  I know
that I have to use the default field of the TextWidget, but I just
can't make it work.

(May be this is a more 'python list' question, if this is the case,
please let me know)

The widgetList i'm subclassing is this one:

// ----------------------------------------------------

class UserFormList(widgets.WidgetsList):
        default_user_name = None
        def __init__(self, arg_user_name = 'hola'):
                widgets.WidgetsList.__init__(self)
                default_user_name = 'asdfasdf'
                return

        user_name = widgets.TextField(
                        name = 'user_name',
                        label = 'Nombre',
                        default = default_user_name,
                        attrs={'size': 32, 'maxlength': 255},
                        validator=v.All(v.NotEmpty, v.UnicodeString))
        user_surname = widgets.TextField(
                        name = 'user_surname',
                        label = 'Apellido',
                        attrs={'size': 32, 'maxlength': 255 },
                        validator=v.All(v.NotEmpty, v.UnicodeString ))
        email_address = widgets.TextField(
                                name='email_address', label='Correo 
electronico',
                                attrs={'size': 32, 'maxlength': 64},
                                validator=v.All(v.NotEmpty, v.Email, 
userKeyExists(field =
'_email_address')))
        display_name =  widgets.TextField(
                                name = 'display_name',
                                label = 'Nick',
                                attrs={'size': 32, 'maxlength': 255},
                                validator=v.All(v.NotEmpty, 
userKeyExists(field= '_display_name')))
        password = widgets.PasswordField(
                        name = 'password',
                        label = 'Contrasena',
                        attrs={'size': 32, 'maxlength': 255},
                        validator=v.All(v.NotEmpty, v.UnicodeString ))
        passwordDuplicate = widgets.PasswordField(
                                name = 'passwordDuplicate',
                                label = 'Verificacion contrasena',
                                attrs={'size': 32, 'maxlength': 255},
                                validator=v.All(v.NotEmpty, v.UnicodeString))
        submit_text = "Ingresar usuario"

insert_user_form= widgets.TableForm(fields=UserFormList(),
                                        validator =
v.Schema(chained_validators=[v.FieldsMatch("password",
"passwordDuplicate")]))

// -----------------------------

I just want to make the default text of user_name to be 'asdfasdf'.
First I declare/define the 'default_user_name' to None, and then, in
the constructor I assign 'asdfasdf' to it. But, when I do a "default =
default_user_name", default_user_name looses the 'asdfasdf' value.

I really don't know whats going on here...please help!

thanks for your time.

--
miya


--~--~---------~--~----~------------~-------~--~----~
 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