I am not completely sure of the context of the thread but to avoid
confusion...

anyhelper.xml() is the same as str(anyhelper) is serialize the
anyhelper in HTML not in XML, as the name suggests.

FORM and SQLFORM are no exception. The operator can be overloaded

class MYFORM(FORM):
    def xml(self):
         return FORM.xml(self)

and you can also redefine the class: FORM=MYFORM.



On Feb 17, 11:25 am, Anthony <[email protected]> wrote:
> On Thursday, February 17, 2011 11:51:03 AM UTC-5, Carlos wrote:
>
> > Hi,
>
> > I can see the book says the following in chapter 7:
>
> >http://www.web2py.com/book/default/chapter/07
>
> > "The class SQLFORM is defined in "gluon/sqlhtml.py". It can be easily
> > extended by overloading its xml method, the method that serializes the
> > objects, to change its output."
>
> > Can you please explain me how SQLFORM xml serialization can be "easily
> > extended"?, what exactly is 'overloading'?, where is this 'xml' method (I
> > can't find in the SQLFORM class in sqlhtml.py)?.
>
> Note, SQLFORM extends the FORM class, so the xml method is in the FORM
> class:http://code.google.com/p/web2py/source/browse/gluon/html.py#1765. It
> looks like FORM.xml ultimately calls DIV.xml 
> (http://code.google.com/p/web2py/source/browse/gluon/html.py#778).
>
> Anthony

Reply via email to