How to call rows format?

40 views
Skip to first unread message

Richard Penman

unread,
Aug 28, 2014, 3:59:48 AM8/28/14
to web...@googlegroups.com
Hello,
my database table defines 'format' - what is the proper way to use this in a view?
Currently I have been using what I found in internals of SQLFORM:
db.tablename._format(record)
Richard

Anthony

unread,
Aug 28, 2014, 8:21:39 AM8/28/14
to web...@googlegroups.com
That's it.

Richard Baron Penman

unread,
Aug 28, 2014, 8:31:22 AM8/28/14
to web...@googlegroups.com

I ask because typically a leading underscore would indicate a private method.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/XX3s-FBTVk4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Aug 28, 2014, 8:42:17 AM8/28/14
to
In this case, the leading underscore is there to ensure the format attribute doesn't clash with any possible field names (which are also accessed as attributes of the table object). See http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Run-time-field-and-table-modification.

Anthony
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

Richard Baron Penman

unread,
Aug 28, 2014, 9:15:55 AM8/28/14
to web...@googlegroups.com
ah OK, that makes sense.

On Thu, Aug 28, 2014 at 2:42 PM, Anthony <abas...@gmail.com> wrote:
> In this case, the leading underscore is more to ensure the format attribute
> doesn't clash with any possible field names (which are also accessed as
> attributes of the table object).
>
> Anthony
Reply all
Reply to author
Forward
0 new messages