Iceberg,

>How about just manually append an "(*)" at the end of your
> label like this?
> db.Field('rechtsvorm', label='Blah (*)', requires=IS_NOT_EMPTY())

One of my table definition reads like:


db.define_table('rechtsvorm',
    SQLField
('rechtsvorm',length=42,default='',notnull=True,unique=True),
    migrate=False)

db.rechtsvorm.rechtsvorm.requires=[IS_LENGTH(42,error_message=T
('length exceeds 42')),IS_NOT_EMPTY(),IS_NOT_IN_DB
(db,'rechtsvorm.rechtsvorm',error_message=T('rechtsvorm already in
database'))]
db.rechtsvorm.rechtsvorm.comment=SPAN('*',_class='required')


Do you suggest to replace SQLField(..) by db.Field(..) and moving the
validators into the field definition instead of defining them beneath
the table definition. I haven't seen this before. In this case my
rechtsvorm table definition would read like:


db.define_table('rechtsvorm',
    dbField('rechtsvorm',label='rechtsvorm
*',length=42,default='',notnull=True,unique=True,requires=[IS_LENGTH
(42,error_message=T('length exceeds 42')),IS_NOT_EMPTY(),IS_NOT_IN_DB
(db,'rechtsvorm.rechtsvorm',error_message=T('rechtsvorm already in
database'))],comment=SPAN('blah'),
    migrate=False)


I think I prefer the separation of definitions being used in the DAL
and definitions being used in SQLFORM. Isn't there a label attribute:

db.rechtsvorm.rechtsvorm.label=T('rechtsvorm *')



> By the way, the length of SQLField('foo','text') can be changed by
> modifying views/web2py_ajax.html:
> $('input.string').attr('size',10);

Thanks.


Kind regards,

Annet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to