hi,

i've already define format in table but it seems return the id instead of 
the format i've define, when i define represent on the field of the other 
field it can work. is it normal?

*e.g. work*
db.define_table('booking',
    Field('scheduled_start', 'datetime'),
    Field('due_date', 'datetime'),
    Field('court', 'reference court'),
    Field('customer', 'reference customer'),
    Field('description', 'text'),
    format=lambda r: '%s %s-%s-%s' % (r.customer.first_name, 
                                         r.customer.last_name, 
r.court.branch.address, 
                                         r.court.court_no))

db.define_table('check_in',
    Field('is_booking', 'boolean'),
    Field('booking', 'reference booking'*, represent=lambda id, r: '%s 
%s-%s-%s' % (r.customer.first_name, r.customer.last_name, 
r.court.branch.address, r.court.court_no)*),
    Field('court', 'reference court'),
    Field('customer', 'reference customer'),
    Field('description', 'text'),
    format=lambda r: '%s %s-%s-%s' % (r.customer.first_name, 
r.customer.last_name, 
                                      r.court.branch.address, 
r.court.court_no))


*e.g. not work*
db.define_table('booking',
    Field('scheduled_start', 'datetime'),
    Field('due_date', 'datetime'),
    Field('court', 'reference court'),
    Field('customer', 'reference customer'),
    Field('description', 'text'),
    format=lambda r: '%s %s-%s-%s' % (r.customer.first_name, 
                                         r.customer.last_name, 
r.court.branch.address, 
                                         r.court.court_no))

db.define_table('check_in',
    Field('is_booking', 'boolean'),
    Field('booking', 'reference booking'),
    Field('court', 'reference court'),
    Field('customer', 'reference customer'),
    Field('description', 'text'),
    format=lambda r: '%s %s-%s-%s' % (r.customer.first_name, 
r.customer.last_name, 
                                      r.court.branch.address, 
r.court.court_no))

thank you very much in advance

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to