Re: [web2py] Re: web2py xml() in python 3

2019-02-20 Thread Maurice Waka
I'm not so conversant with that. On Thu, Feb 21, 2019 at 2:10 AM Dave S wrote: > > > On Wednesday, February 20, 2019 at 1:13:03 PM UTC-8, Maurice Waka wrote: >> >> Hi, >> I know I asked this before. I know people are very busy but could someone >> help here. >> From this web2py page: >> http://

[web2py] Re: web2py xml() in python 3

2019-02-20 Thread Dave S
On Wednesday, February 20, 2019 at 1:13:03 PM UTC-8, Maurice Waka wrote: > > Hi, > I know I asked this before. I know people are very busy but could someone > help here. > From this web2py page: > http://www.web2py.com/books/default/chapter/29/11/jquery-and-ajax?search=xml%28%29 > I got this co

[web2py] web2py xml() in python 3

2019-02-20 Thread Maurice Waka
Hi, I know I asked this before. I know people are very busy but could someone help here. >From this web2py page: http://www.web2py.com/books/default/chapter/29/11/jquery-and-ajax?search=xml%28%29 I got this code but does not work with python 3.6. Any help out there???, plese def month_inpu

[web2py] Xml use in python 3.6

2019-02-18 Thread Maurice Waka
Hallo. I created this issue in github but no response so far. "xml() in python 3.6 · Issue #2096 · web2py/web2py" https://github.com/web2py/web2py/issues/2096 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://cod

[web2py] "xml() in python 3.6 · Issue #2096 · web2py/web2py" https://github.com/web2py/web2py/issues/2096

2019-02-18 Thread Lovedie JC
"xml() in python 3.6 · Issue #2096 · web2py/web2py" https://github.com/web2py/web2py/issues/2096 -- 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 recei

[web2py] xml namespaces

2018-02-02 Thread Yebach
Hello Although not so much web2py question and more Python. I am struggling with creating some xmls - more specific namespaces. I would really appreciate it if smbd could help me with this I am trying to get all the namespaces together., but somehow they are not named or declared properly, eve

Re: [web2py] xml() error when BEAUTIFY globals()

2017-03-23 Thread Richard Vézina
Maybe because .xml() method of various web2py class in gluon.html and is intent to be used over markup type languages not python language : https://github.com/web2py/web2py/blob/master/gluon/html.py#L548 You can search for "def xml(" on this page to see all the differents implementation... Richa

[web2py] xml() error when BEAUTIFY globals()

2017-03-23 Thread Lars
Hi, Everything is in the title : I try to have a BEAUTIFY look at copy.copy(globals()) and I get an xml error line 131 in html.py : data is empty for : return data.xml() Why can't we beautify globals() ? Thank you -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

[web2py] XML(sanitize=True) and incorrect HTML

2016-06-14 Thread Kirill Shatalaev
Hello. XML crashes while trying to sanitize some sorts of incorrect html. For example: a = '' # wrong html b = XML(a, sanitize=True) pop from empty list I suppose this is a severe bug. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2

[web2py] XML object

2016-03-20 Thread Jerry Liu
Hi, all I want to use XML object to stop html from being escaped. But the object seems not working on iframe tag. I override it like this: XML(text, sanitize=True, permitted_tags=['iframe', ...], allowed_attributes={'iframe':[...]}) -- Resources: - http://web2py.com - http://web2py.

[web2py] XML pickle/unpickle

2015-09-16 Thread Maxim Hrustalev
Does anyone with deep knowledge of web2py know why this code is included in html.py 667 ### important to allow safe session.flash=T() 668 669 670 def XML_unpickle(data): 671 return marshal.loads(data) 672 673 674 def XML_pickle(data): 675 return XML_unpickle, (marshal.dumps(str(data))

[web2py] XML helper mangles svg file with namespace prefixes

2015-07-28 Thread jackson . read
IN a controller if I return an svg that has full namspace prefixes (default for the python xml package 'tostring' method )via the XML helper it is mangled it beyond recognition. The same svg works in emacs as well as loaded as a file in the bowser. ns0 ns1 etc namepsace prefixes are verbose bu

[web2py] XML pickle

2015-07-09 Thread Maxim Hrustalev
Can anyone explain why this code is included in html.py: 667 ### important to allow safe session.flash=T() 668 669 670 def XML_unpickle(data): 671 return marshal.loads(data) 672 673 674 def XML_pickle(data): 675 return XML_unpickle, (marshal.dumps(str(data)),) 676 copy_reg.pickle(XML,

[web2py] xml view

2015-05-18 Thread Mirek Zvolský
I don't know how to write xml views. Basic content: {{from gluon.serializers import xml}}{{=XML(xml(response._vars,quote=False))}} is not good for me, because just a wrapper like ... is Ok, but the content which are rows from db().select() - and xml tags for the single rows are escaped: <.item>.

[web2py] {{=XML(row.contents, sanitize=True)}} and

2014-07-02 Thread Annet
In a view I have the following line: {{=XML(row.contents, sanitize=True)}} When 'contents' contains an element add by tinymce, this element isn't being rendered: My text Other elements like are being rendered correctly, is there a way to solve this issue. Regards, Annet -- Resour

[web2py] {{=XML(data)}} for javascript variable issue

2014-06-12 Thread LoveWeb2py
Hello, I'm trying to pass a variable which has json data into infovis for a visualization It's interesting because when I type {{=XML(data)}} in the view I can see the correct json data is being passed, but when I edit the .js file and try to include the variable there nothing happens (it says

[web2py] XML, sanitize

2013-02-04 Thread Martijn Hermans
I've got a website in wich I want to allow the user some customization. To prevent my site from injection, I use : {{=XML(markup,sanitize=True)}} This works perfect, except it doesn't allow the tags 'font' and 'span'. I know I can override this default behaviour, but I want to know if I expose

[web2py] XML response

2012-12-13 Thread Charis
Hi all, I would like to ask how I can generate an XML response to the views instead of html (index.xml instead of index.html) Thank you, Charis --

Re: [web2py] XML Webservice

2012-10-01 Thread Massimo Di Pierro
Done. In trunk. On Monday, 1 October 2012 13:47:50 UTC-5, Derek wrote: > > I think there should be some kind of encoding mentioned in the file, > especially if you want to output valid XML. It assumes UTF-8 if an encoding > isnt' provided, but since this is an international software, with > tra

Re: [web2py] XML Webservice

2012-10-01 Thread Derek
I think there should be some kind of encoding mentioned in the file, especially if you want to output valid XML. It assumes UTF-8 if an encoding isnt' provided, but since this is an international software, with translations, ISO-8859-1 would be a good default. It should be configurable though,

Re: [web2py] XML Webservice

2012-09-28 Thread Massimo Di Pierro
Should this line be there in the default generic.xml? On Friday, 28 September 2012 20:02:26 UTC-5, Derek wrote: > > https://web2py.com/books/default/chapter/29/10#HTML,-XML,-and-JSON > > I didn't see your response, sorry. Read this chapter. Notice the > "generic.xml" code: > {{ > try: >from g

Re: [web2py] XML Webservice

2012-09-28 Thread Derek
https://web2py.com/books/default/chapter/29/10#HTML,-XML,-and-JSON I didn't see your response, sorry. Read this chapter. Notice the "generic.xml" code: {{ try: from gluon.serializers import xml response.write(xml(response._vars),escape=False) response.headers['Content-Type']='text/xml' e

Re: [web2py] XML Webservice

2012-09-05 Thread hasan alnator
Dear derek, This is my first time useing web service .. Can you please give me a simple example of what you are talking about .. How to creat a template .. And how fo add fields .. Thank you a lot. On Sep 5, 2012 11:21 PM, "Derek" wrote: > > > Create a template with xmlservice.xml and add the a

Re: [web2py] XML Webservice

2012-09-05 Thread Derek
Create a template with xmlservice.xml and add the appropriate fields. On Wednesday, September 5, 2012 12:50:28 AM UTC-7, Hassan Alnatour wrote: > > Dear Derek , > > What should i do then ?? > > Best Regards, > > On Wed, Sep 5, 2012 at 2:01 AM, Derek >wrote: > >> It is XML, but it doesn't have a

Re: [web2py] XML Webservice

2012-09-05 Thread hasan alnator
Dear Derek , What should i do then ?? Best Regards, On Wed, Sep 5, 2012 at 2:01 AM, Derek wrote: > It is XML, but it doesn't have a doctype. So, when it gets to this > character: *’* it fails to validate against UTF-8. It should probably > be this: charset=ISO-8859-1 > > > On Tuesday, Septe

Re: [web2py] XML Webservice

2012-09-04 Thread Derek
It is XML, but it doesn't have a doctype. So, when it gets to this character: *’* it fails to validate against UTF-8. It should probably be this: charset=ISO-8859-1 On Tuesday, September 4, 2012 2:15:11 AM UTC-7, Hassan Alnatour wrote: > > Dear ALec , > > when i go to the link i gave you be

Re: [web2py] XML Webservice

2012-09-04 Thread hasan alnator
Dear ALec , when i go to the link i gave you before , i can see some XML data but i dont understand what is the viewing problem you are talking about ? and why wold a table filed interrupter Viewing as XML as long as i am returning an object that has all the date ? Best Regards, On Sun, Sep 2,

Re: [web2py] XML Webservice

2012-09-02 Thread hasan alnator
Dear ALec , when i go to the link i gave you before , i can see some XML data but i dont understand what is the viewing problem you are talking about ? and why wold a table filed interrupter Viewing as XML as long as i am returning an object that has all the date ? Best Regards, On Sun, Sep 2,

Re: [web2py] XML Webservice

2012-09-02 Thread Alec Taylor
Hmm, try lower-case 'description'. Otherwise not sure what's causing the XML viewer problem. Also nowadays JSON is prefered over XML, as it's much less verbose; thus has a much lower overhead On Sun, Sep 2, 2012 at 7:39 PM, hasan alnator wrote: > Dear Alec , > > What Do you mean with preproces

Re: [web2py] XML Webservice

2012-09-02 Thread hasan alnator
Dear Alec , What Do you mean with preprocessing ? this is my db.py : # -*- coding: utf-8 -*- # ## This scaffolding model makes your app work on Google App Engine too ## File is released under public domain and you can use

Re: [web2py] XML Webservice

2012-09-02 Thread Alec Taylor
Yeah, that's right. Sounds like you'll need to do some preprocessing before posting it out though. Share your models.py and we'll work from there On Sun, Sep 2, 2012 at 6:22 PM, hasan alnator wrote: > Dear Alec , > > Is the the right way : > > in the controller i added >> > > def call(): > s

Re: [web2py] XML Webservice

2012-09-02 Thread hasan alnator
Dear Alec , Is the the right way : in the controller i added >> def call(): session.forget() return service() @service.run def xmlservice(): solutoins = db().select(db.solutions.ALL) return locals() then i get this : http://gardeniatelco.com/call/xml/xmlservice On Sun, Sep

Re: [web2py] XML Webservice

2012-09-02 Thread Alec Taylor
Just add the @service.xml decorator to your controller. Tutorial: https://web2py.com/books/default/chapter/29/10 On Sun, Sep 2, 2012 at 5:57 PM, Hassan Alnatour wrote: > Dear ALL, > > I want to create a web service that returns an xml of the > some recorders in a table ? > > Best Regards, > >

[web2py] XML Webservice

2012-09-02 Thread Hassan Alnatour
Dear ALL, I want to create a web service that returns an xml of the some recorders in a table ? Best Regards, --

[web2py] xml generated by web2py restful api

2012-03-20 Thread castanets
restful api generated xml like as below : 1 is there any method that the result is changed like this? : 1 Thanks.

[web2py] xml-rpc code causes compile error in mywiki default.py

2012-02-08 Thread bill.tha...@live.com
Hello, While working through the book I got to the part in chapter 3 mywiki where you replace "def call()..." function with [code] service = Service() @service.xmlrpc def find_by(keyword): "finds pages that contain keyword for XML-RPC" return db(db.page.title.contains(keyword).selec

[web2py] xml view of dict() with attributes

2011-10-23 Thread KMax
Hello, Please help with exporting some dict to .xml view with attributes inside tags. Like: Title Value I am talking about "hello='world'" in the itemtitle tag. I know, I could do it with TAG, but how to make it using regular dict() return? i mean: def myxml(): return dict(itemti

Re: [web2py] xml-rpc service, unicode string

2011-10-04 Thread José Luis Redrejo Rodríguez
2011/10/4 synergetic : > Hello members, > > I have a following problem. In service.py controller I have > -- > def call(): >  return service() > > @service.xmlrpc > def get_modules(): >    modules = db().select(

[web2py] xml-rpc service, unicode string

2011-10-04 Thread synergetic
Hello members, I have a following problem. In service.py controller I have -- def call(): return service() @service.xmlrpc def get_modules(): modules = db().select(db.Module.ALL).as_list() return dic

Re: [web2py] xml in response not well formed

2011-09-25 Thread Jonathan Lundell
FWIW, it looks to me like the extra lines are left over from a previous response (or something like that) and not being generated by this particular invocation of the view. Why that would happen I have no idea. On Sep 25, 2011, at 2:38 PM, Martin wrote: > Hello All, sorry for the bother I am

[web2py] xml in response not well formed

2011-09-25 Thread Martin
Hello All, sorry for the bother I am having an issue with Version 1.99.1 (2011-09-22 16:59:24) stable release. It seems to be that there are some problems when parsing the .xml view file, not sure. I have a function (device_cfg) in controllers/default.py, which performs some processing and pass to

[web2py] XML-RPC Service Introspection / Discovery

2011-09-12 Thread Ross Peoples
One of the nice things about SOAP is the WDSL that gives you information about the methods the service supports. I recently discovered that you can do the same thing with XML-RPC. The trick is to document your methods properly, like you should be doing anyways. Lets say I have the following con

[web2py] xml to string or json

2011-05-24 Thread Resa
Specifically i have data that is in XML (grade) in my controller and i wanted to parse it. eg grade.find(".").. however this would clearly not work.. are there any suggestions as to how i can convert this XML data in the controller to a format that is parse-able

[web2py] xml()

2011-04-15 Thread 黄祥
hi, pardon me, i want to ask what's the meaning of this : URL('default','index').xml()==URL().xml() here's the complete code: response.menu = [ (T('Index'),URL('default','index').xml()==URL().xml(),URL('default','index'), []), ] i mean it is convert the url into xml format page? thanks and b

[web2py] XML manipulation

2011-03-20 Thread villas
Hi All, I would like to extract XML from a table and then manipulate it. The process being something like this in horrible pseudo-code: my table fields = id:1, name:Alan, price:5 xmldata = table.xml transform xmldata, e.g. xmldata.replace_element_name('name', 'newname') xmldata.replac

[web2py] XML() object in html.py breaks ajax callback which needs HTML returned.

2011-03-07 Thread dlypka
Ever since web2py 1.91.6 I have had to patch html.py to avoid this exception when my code tries to do an ajax callback to get some HTML: Traceback (most recent call last): File "c:\Google\AppEngine\esentrnet\gluon\restricted.py", line 188, in restricted exec ccode in environment File "c:\G

[web2py] XML service

2010-12-10 Thread villas
If I make a function with named fields, e.g. def cargroup(): carlist = db(db.cargroup).select('descr','seats',orderby="descr").as_list() return dict(carlist=carlist) Then call it with .xml extension, I get an <_extra> tag element for each row, e.g.: <_extra>Chevrolet Matiz3 Why do we

[web2py] xml advise

2010-11-29 Thread Johann Spies
I have been busy with web2py for about a year and I am learning every day. I am also a newby as far as xml-processing is concerned. So I would like advice about the way to go with the following setup: I want to import xml-data collected through a soap client into a database. This will involve sev

[web2py] XML on GAE

2010-10-06 Thread Relsi Hur
Hello, I'm learning to use web2py and created a small application and deploy on GAE, in this app I have a action that return a xml: #xml tags def export_xml(rows): idx=range(len(rows.colnames)) colnames=[item.replace('users.','') for item in rows.colnames] users=[] for row in rows.

[web2py] XML+URL continuing problem

2010-08-20 Thread Michael Wolfe
Look at revisions 804, 808, and 811 in web2py's hg repos. R804: URL+XML, and oauth1.0 from Michele === (+6,-3) gluon/html.py === @@ -201,8 +201,8 @@ if regex_crlf.search(url): raise SyntaxError, 'CRLF Injection Detected' -return rewrite.filter_out(url, env) - +return XML(r

Re: [web2py] XML sanitizer question

2010-07-22 Thread Jonathan Lundell
On Jul 22, 2010, at 7:04 PM, mr.freeze wrote: XML('test',sanitize=True,permitted_tags = ['b']).xml() > 'test' XML('test',sanitize=True,permitted_tags = ['a']).xml() > 'test' > > Why does the 'a' element get sanitized? At first glance, it looks like it might require an attribute from a

[web2py] XML sanitizer question

2010-07-22 Thread mr.freeze
>>> XML('test',sanitize=True,permitted_tags = ['b']).xml() 'test' >>> XML('test',sanitize=True,permitted_tags = ['a']).xml() 'test' Why does the 'a' element get sanitized?

[web2py] XML with custom TAG

2010-04-05 Thread Jason Lotz
I'm trying to pass an XML string with custom TAG to a view, but I'm having trouble with syntax. Required XML Syntax: cell content cell content The code string in the controller: rowxml=TAG.rows(*[TAG.row(*[TAG.cell(r[f]) for f in rowflds]) for r in rows