>
>     record = db.patient(request.args(0))

    db.appointment.patient.default = record
>

Above "record" is a row object, but db.appointment.patient is a reference 
field, which simply stores the integer ID of the record it references. So, 
that second line should just be:

    db.appointment.patient.default = request.args(0)

No need to query db.patient to pull the record.
 

> And that gives me the whole record but I am looking for just the name of 
> the patient in this case. IN my db I set format='%(first_name)s 
> %(last_name)s') expecting to get that returned on the record but not so.
>

You might need to show your model code. If you have:

db.define_table('patient', ..., format='%(first_name)s %(last_name)s')
db.define_table('appointment', ..., Field('patient', 'reference patient'))

The you should get a <select> in the form with first and last name in the 
options. If that's not happening, show some more code.

Anthony

>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to