Hi,

I am fresh to tg-widgets  , i want my table in my desired format, how
can i apply the css and do the formats.

MyCode:

class UniqueUsername(formencode.FancyValidator):
        def _to_python(self, value, state):
                try:
                        usernames=model.DAMUser.byUser_name(value)
                        raise formencode.Invalid('Username already 
exists',value,state)
                except model.SQLObjectNotFound:
                        pass
                return value

class UniqueEmail(formencode.FancyValidator):
        def _to_python(self, value, state):
                try:
                        email=model.DAMUser.byEmail(value)
                        raise formencode.Invalid('Email already 
exists',value,state)
                except model.SQLObjectNotFound:
                        pass
                return value

class Registration(validators.Schema):
        fullname = validators.UnicodeString(not_empty=True)
        username =
formencode.All(validators.UnicodeString(not_empty=True),validators.PlainText(),UniqueUsername())
        email=
formencode.All(validators.Email(not_empty=True,strip=True),UniqueEmail())


class RegistrationFeilds(widgets.WidgetsList):
        fullname=widgets.TextField(label="Full Name",name="fullname")
        username= widgets.TextField(label='UserName',name="username")
        email= widgets.TextField(label='Email',name="email")
        auth= widgets.SingleSelectField(options=[("Disable"),("SAM"),
("DAM")],default="Disable",label="Authentication")


add_form = widgets.TableForm(
        name="add",
        fields=RegistrationFeilds(),
        validator=Registration(),
        action="register",
        submit_text="Save"
        )

Thanks
Antony


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