>
> Thanks. 
> I have a user object in the memory, may be I can use it to store the data 
> in session. Let me try this out.
> In the meantime, can you explain what does the line no: 1959 (as below) 
> does ??
>
> 1959 user = 
> Storage<http://www.web2py.com/examples/static/epydoc/web2py.gluon.tools-pysrc.html#>
> (table_user._filter_​​​fields<http://www.web2py.com/examples/static/epydoc/web2py.gluon.tools-pysrc.html#>
> (user, id=True)) 
>

table_user._filter_fields(user, id=True)

just converts the user record (which is a Row object) to a dict. I'm not 
sure why the _filter_fields method is used, as I believe this would just be 
equivalent to the simpler user.as_dict(). The additional benefit of 
_filter_fields is that it filters out any fields that are not included in 
the table definition, but in this case that is unnecessary, as the user object 
comes directly from the user table and therefore would not include any 
extraneous fields.

After conversion to a dict, user is then converted to a Storage object, 
which enables you to access the fields as attributes (i.e., user.first_name, 
etc.).

Anthony

Reply via email to