[web2py] Re: xml view

2015-05-20 Thread Mirek Zvolský
My experiments and previous comment (to LoveWeb2py) were slow and late. Thank you Massimo for exact answer. So it is very similar to normal views. I just was confused with the content of views/generic.xml which seems has problems with escaping for more complicated rendered data. Dne středa

[web2py] Re: xml view

2015-05-20 Thread Mirek Zvolský
Thank you. That works. And I have found that I can have more control over the tag structure so: {{for invoice in invoices:}} {{=invoice.amount}} {{pass}} It looks so that there aren't problems with escaping as I have described in the original question. Dne pondělí 18. k

[web2py] Re: xml view

2015-05-20 Thread Massimo Di Pierro
You would do this, for example # in model db.define_table('person',Field('name')) # controller def mydata(): rows = db(db.person).select() return dict(rows=rows) # create a view default/mydata.xml {{for row in rows:}}{{=row.name}}{{pass}} the call http:///mydata.xml You can als

[web2py] Re: xml view

2015-05-18 Thread LoveWeb2py
This should work: controller: data = db(db.table.id>0).select() return dict(data=data) view: {{=data.xml()}} On Monday, May 18, 2015 at 1:52:31 PM UTC-4, Mirek Zvolský wrote: > > I don't know how to write xml views. > > Basic content: {{from gluon.serializers import > xml}}{{=XML(xml(response.

[web2py] Re: xml view of dict() with attributes

2011-10-26 Thread villas
@Kmax, nice solution!

Re: [web2py] Re: xml view of dict() with attributes

2011-10-25 Thread Richard Vézina
You right after sent my mail I told myself I should precise my suggestion :) Richard On Tue, Oct 25, 2011 at 10:31 AM, KMax wrote: > I am sure for complicated response lxml is the best. But for simple > response is TAG. > > On 24 окт, 23:16, Richard Vézina wrote: > > lxml is pretty nice lib f

[web2py] Re: xml view of dict() with attributes

2011-10-25 Thread KMax
I am sure for complicated response lxml is the best. But for simple response is TAG. On 24 окт, 23:16, Richard Vézina wrote: > lxml is pretty nice lib for the task... > > Richard > > On Mon, Oct 24, 2011 at 11:57 AM, KMax wrote: > > my solution: > > > def myxml(): > >    .. > >    return

Re: [web2py] Re: xml view of dict() with attributes

2011-10-24 Thread Richard Vézina
lxml is pretty nice lib for the task... Richard On Mon, Oct 24, 2011 at 11:57 AM, KMax wrote: > my solution: > > def myxml(): >.. >return '' + > str(TAG.response(TAG.result('0'), >*[TAG[parameter](request.get_vars[parameter]) > for parameter in request.ge

[web2py] Re: xml view of dict() with attributes

2011-10-24 Thread KMax
my solution: def myxml(): .. return '' + str(TAG.response(TAG.result('0'), *[TAG[parameter](request.get_vars[parameter]) for parameter in request.get_vars])) So, anyone could customize it on their needs. Thanks Massimo. On 24 окт, 21:15, Massimo Di Pierro

[web2py] Re: xml view of dict() with attributes

2011-10-24 Thread Massimo Di Pierro
Yes. You need to implement your own XML serializer. You can use helpers too for this purpose. It really depends on how your output should look like. On Oct 23, 11:07 pm, KMax wrote: > So, with return dict() and generic.xml view is impossible to produce > attribute in a xml tag? > Just to stop loo

[web2py] Re: xml view of dict() with attributes

2011-10-23 Thread KMax
So, with return dict() and generic.xml view is impossible to produce attribute in a xml tag? Just to stop looking in this way for solution. Thanks Massimo. On 23 окт, 22:53, Massimo Di Pierro wrote: > You can make a myxml.html view that contains: > > > >    {{=itemtitle}} >    {{=itemvalue}} >

[web2py] Re: xml view of dict() with attributes

2011-10-23 Thread Massimo Di Pierro
You can make a myxml.html view that contains: {{=itemtitle}} {{=itemvalue}} On Oct 23, 5:09 am, KMax wrote: > Hello, >   Please help with exporting some dict to .xml view with attributes > inside tags. > > Like: > > > >    Title >    Value > > > I am talking about "hello='world'" in