>
> Three questions:
>
>    1. What's the 'magic' going on that tells the display code for 
>    meetTeams to use the 'format' expression (but not to use it when 
> displaying 
>    'message')? Does it realize it's a row, and the row knows how to display 
>    using the format?
>    
> When you create a reference field, if you don't give it any validator, it 
will automatically get an IS_IN_DB validator, and its "represent" attribute 
will automatically be set to the "format" attribute of the referenced 
table. The "represent" attribute is only used by SQLTABLE (i.e., when you 
include an entire Rows object in a view), SQLFORM, and SQLFORM.grid. If you 
simply display a single value from a Row object, the "represent" attribute 
is not used. 

>
>    1. Are the results of that 'format' expression stored in the row, 
>    available to me to use? As you can see I can explicitly join with the 
>    Institution to get the name. But if there's an easier way, then I'll do it.
>    
> You can access the format expression either via db.Institution._format or 
db.Team.Institution.represent (the latter is actually a function that will 
reference the former).

Anthony

-- 



Reply via email to