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
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
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
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.
@Kmax, nice solution!
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
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
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
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
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
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}}
>
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
12 matches
Mail list logo