On Jan 15, 7:01 am, MadWalker <[email protected]> wrote:
> hi,
>
> is it able to set a key column on a table to be unique
> like for example; user name
> if not,
> is there another way to do it?
>
> Good day,
> Madwalker

in model file:
db.define_table('table'
      db.field('name','string',unique=True))

#FORM VALIDATION
db.table.name.requires=IS_NOT_IN_DB(db, 'table.name')

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to