[web2py] Re: web2py slices down

2016-04-24 Thread Henk huisman
Yes already 3 days down.
Anybody home?


Op zondag 24 april 2016 11:29:57 UTC-4 schreef luis.va...@metamaxzone.com:
>
> Web2py slices (http://www.web2pyslices.com/home) is down, shows a ticket 
> when try to access
>
> Internal errorTicket issued: unknown 
> 
>

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Multiple selection dropdown widget, UI

2016-04-24 Thread Ron Chatterjee
 duration_str = ('Month or less', '6 months', '1 year')

Field('duration', type='list:string',requires=IS_IN_SET((duration_str), 
multiple=True),widget=lambda field, value: 
SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
label=True)),

This create a multiple selection but the UI is very generic. Wondering if 
any widget will give me an UI similar to the link below (explained in pic) 
with tags?

http://semantic-ui.com/modules/dropdown.html

See section
"Multiple Selection 

A selection dropdown can allow multiple selections

"



-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py.com down?

2016-04-24 Thread pbreit
working now

On Sunday, April 24, 2016 at 8:06:04 AM UTC-7, pbreit wrote:
>
> I'm getting the PythonAnywhere "Error code: 502-loadbalancer" and no site 
> since last night.
>

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Invalid function after compiling app

2016-04-24 Thread luis . valladares
Hello!

i've a web2py app that works well, my default controller is "inicio" and 
his default function is index, so the index page of my app si 
app/inicio/index, this works well uncompiled, but when i go to the web2py 
admin app and compile this app the next request returns: invalid function 
(inicio/index) and every requests say this, im using the version 
"2.12.3-stable+timestamp.2015.08.18.19.14.07" 
and after i delet the compiled files, everything works good again. What can 
be the problem?

Thanks for your help!

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] web2py slices down

2016-04-24 Thread luis . valladares
Web2py slices (http://www.web2pyslices.com/home) is down, shows a ticket 
when try to access

Internal errorTicket issued: unknown 


-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: [REST] encoding character in query patterns

2016-04-24 Thread Mamisoa Andriantafika
The goal is to receive the right result from the query in the GET request.

As you saw, in the first query I get the result of the user that where 
first name, name and dob correspond to the parameters.

But when I had the accented character, I cannot get the expected same 
result.

>From the first response, one can see that the query may have been done in 
UTF8. So I think that I should feed the GET request with a kind of UTF8 
encoded characters, although I'm already in UTF8?

Le dimanche 24 avril 2016 14:57:23 UTC+2, Richard a écrit :
>
> I don't understrand... Are you trying to generate this URL or you receive 
> the request? Does it fails for a request you receive?
>
> On Sat, Apr 23, 2016 at 8:38 PM, Mamisoa Andriantafika  > wrote:
>
>> Just to be clearer, here is a response from the following get:
>>
>>
>> https://localhost/test/default/api_users/user/ma/li/1978-01-01
>>
>>
>>
>>
>> {"content": [{"birth_country_pid23": "France", "first_name":
>> "Ma\u00eft", "last_name": "Li\u00e9", "modified_by": null,
>> "id": 42, "gender_pid8": 2, "created_by": null, "birth_town_pid23":
>> "Paris", "ssn_pid19": "", "created_on": "2016-04-23 15:59:49",
>> "modified_on": "2016-04-23 15:59:49", "maiden_name_pid6":
>> "Li\u00e9", "idc_num": "", "dob_pid7": "1978-01-01"}]}
>>
>>
>> but if I add the search with the accent:
>>
>>
>> https://localhost/test/default/api_users/user/maï/lié/1978-01-01
>>
>>
>>
>>
>> {"content": []}
>>
>>
>>
>>
>> ??
>>
>> Le samedi 23 avril 2016 22:48:29 UTC+2, Mamisoa Andriantafika a écrit :
>>>
>>> Hi,
>>>
>>> Using this usual REST code in controller : 
>>>
>>> def api_users():
>>> response.view = 'generic.json' # or 'generic.' + request.extension
>>> def GET(*args,**vars):
>>> patterns = [
>>> "/user[auth_user]",
>>> "/user/{auth_user.id}",
>>> "/user/{auth_user.id}/:field",
>>> 
>>> "/user/{auth_user.first_name.contains}/{auth_user.last_name.contains}/{auth_user.dob_pid7.eq}"
>>> ]
>>> db.auth_user.created_by.readable = 
>>> db.auth_user.modified_by.readable 
>>> = db.auth_user.created_on.readable = db.auth_user.modified_on.readable = 
>>> True
>>> parser = db.parse_as_rest(patterns, args, vars)
>>> data = parser.response
>>> if parser.status == 200:
>>> return dict(content=data)
>>> else:
>>> raise HTTP(parser.status, parser.error)
>>>
>>> with the last pattern, if I use character with accent e.g:
>>>
>>> /user/maït/lié
>>>
>>> the query do not find match as it is not interpreted as: 
>>>
>>> "ma\u00eft" for first vars and
>>> "li\u00e9" for the second vars
>>>
>>> which is the encoding I find when I do the request /user/ma/li .
>>>
>>> How can I correct the encoding transcription so that the request comply 
>>> to the format:
>>>
>>> /user/maï/lié
>>>
>>> ?
>>>
>>> Mike
>>>
>>>
>>>
>>> -- 
>> 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 the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] web2py.com down?

2016-04-24 Thread pbreit
I'm getting the PythonAnywhere "Error code: 502-loadbalancer" and no site 
since last night.

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] show uploaded filename in SQLFORM.grid

2016-04-24 Thread rajjmatthur


db.define_table('Files',
Field("filename", "upload",default=None, 
uploadfolder=os.path.join(request.folder, 'uploads')))

grid = SQLFORM.smartgrid(db.Files)


Displays:
List id, and file.

IdFilename
1file

How to show the uploaded filename instead file?

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SOAP XML Element Question

2016-04-24 Thread Pbop
First, I highly recommend http://www.soapclient.com/soaptest.html as a 
resource to reverse engineer soap parameters and test soap calls. If it 
works from this site and not in your Web2Py code, your code is broken, not 
the SOAP client. The soap client parameters are poorly documented and the 
documentation in the Webplus manual looks at the implementation through the 
lens from what works in Web2Py, which is probably a best practice / 
standard practice, but is not followed in the free SOAP services out there. 
The soaptest site will return a ServerAddress once the WSDL/Description 
file is specified. This is the location property when defining the soap 
client. 

I know if I had a working sample, it would have saved me time, so for the 
benefit of the community, here is a  working sample; however, I would like 
to get feedback in how I am parsing out the XML response as while it works 
this seems a little convoluted with tools I have used in the past. I got 
this approach from another thread: 

def test_soap_sub2():
  from gluon.contrib.pysimplesoap.client import SoapClient, SoapFault
  from xml.dom import minidom
  # create a SOAP client
  client = 
SoapClient(location="http://ladonize.org/python-demos/Calculator/soap;, 
cacert=None, trace=True, namespace='addResponse', ns='addResponse')
  # call SOAP method
  response = client.add(a='5',b='54')
  try:
result = response['result']
x = client.xml_response
parsed_data = minidom.parseString(x)
newresult = parsed_data.getElementsByTagName('result')
result = newresult[0].firstChild.toxml()
  except SoapFault:
result = 'l'
  return dict(xml_request=client.xml_request,
xml_response=client.xml_response,
result=result)

Note that I am importing minidom
  from xml.dom import minidom

And then am jumping through this hoop to get the result...
parsed_data = minidom.parseString(x)
newresult = parsed_data.getElementsByTagName('result')
result = newresult[0].firstChild.toxml()

In the example in the manual, the result assignment is:
  result = response('AddResult')

The SOAP call has this response:
http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>http://localhost:8000/webservices/sample/call/soap;>5

So my first question is why does this work? The AddResult tags are not 
wrapped in a namespace, but I am missing something fundamental here. 

In my working example above. the soap calls has this response:
http://schemas.xmlsoap.org/soap/encoding/; 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:ns="urn:Calculator" xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>http://schemas.xmlsoap.org/soap/encoding/;>59

Where the result tag is wrapped around 
59

So the second question is whether there is a better way to access the 
result tag without having to parse the dom? Or said a different way, why 
does the approach in the manual eg  result = response('result') fail? 




-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Adding appended text to SQLFROM

2016-04-24 Thread Ron Chatterjee


On Sunday, April 24, 2016 at 9:51:35 AM UTC-4, Ron Chatterjee wrote:
>
> Any example you can provide. lol. I have this chat application, I have an 
> file upload, that I use a div element to put below the form inside a table 
> (attached) which is not included in the same table (separate table for the 
> text and the file upload). I am hoping, if I can do something like a 
> prepended text included in the form, may be I can then use the file upload 
> attached to the form like shown in the picture (attached).
>
> Do I need to create a separate table for appended or prepended text?
>
>
> On Thursday, April 14, 2016 at 8:56:28 PM UTC-4, Stuart Rolinson wrote:
>>
>> Ron,
>>
>> I am pretty sure the only way to do this would be a custom for, so yes 
>> {{=form.custom.begin}}.
>>
>> {{=form.custom.begin}}
>> 
>>
>> 
>> Form Name
>>
>> 
>> 
>>   Appended 
>> Text
>>   
>> 
>>   {{=form.custom.widget.appendedtext}}
>>   append
>> 
>> help
>>   
>> 
>> 
>> {{=form.custom.end}}
>>
>> Hope that helps.
>> Stuart.
>>
>> On Thursday, April 14, 2016 at 7:39:56 AM UTC-7, Ron Chatterjee wrote:
>>>
>>> db.define_table("search_table",
>>> Field('search_string', 'string'))
>>>
>>>
>>>
>>> form = SQLFORM(db.search_table);
>>>
>>>
>>> view {{=form}}
>>>
>>>
>>> If I have to use validators and security of SQLFORM, how do I add 
>>> appended text to this form?I am guessing {{=form.custom.begin}}?
>>>
>>>
>>>

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Adding appended text to SQLFROM

2016-04-24 Thread Ron Chatterjee
Any example you can provide. lol. I have this chat application, I have an 
file upload, that I use a div element to put below the form inside a table 
(attached) which is not included in the same table (separate table for the 
text and the file upload). I am hoping, if I can do something like a 
prepended text included in the form, may be I can then use the file upload 
attached to the form like shown in the picture (attached).

Do I need to create a separate table for appended or prepended text?


On Thursday, April 14, 2016 at 8:56:28 PM UTC-4, Stuart Rolinson wrote:
>
> Ron,
>
> I am pretty sure the only way to do this would be a custom for, so yes 
> {{=form.custom.begin}}.
>
> {{=form.custom.begin}}
> 
>
> 
> Form Name
>
> 
> 
>   Appended 
> Text
>   
> 
>   {{=form.custom.widget.appendedtext}}
>   append
> 
> help
>   
> 
> 
> {{=form.custom.end}}
>
> Hope that helps.
> Stuart.
>
> On Thursday, April 14, 2016 at 7:39:56 AM UTC-7, Ron Chatterjee wrote:
>>
>> db.define_table("search_table",
>> Field('search_string', 'string'))
>>
>>
>>
>> form = SQLFORM(db.search_table);
>>
>>
>> view {{=form}}
>>
>>
>> If I have to use validators and security of SQLFORM, how do I add 
>> appended text to this form?I am guessing {{=form.custom.begin}}?
>>
>>
>>

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: [REST] encoding character in query patterns

2016-04-24 Thread Richard Vézina
I don't understrand... Are you trying to generate this URL or you receive
the request? Does it fails for a request you receive?

On Sat, Apr 23, 2016 at 8:38 PM, Mamisoa Andriantafika 
wrote:

> Just to be clearer, here is a response from the following get:
>
>
> https://localhost/test/default/api_users/user/ma/li/1978-01-01
>
>
>
>
> {"content": [{"birth_country_pid23": "France", "first_name":
> "Ma\u00eft", "last_name": "Li\u00e9", "modified_by": null,
> "id": 42, "gender_pid8": 2, "created_by": null, "birth_town_pid23":
> "Paris", "ssn_pid19": "", "created_on": "2016-04-23 15:59:49",
> "modified_on": "2016-04-23 15:59:49", "maiden_name_pid6":
> "Li\u00e9", "idc_num": "", "dob_pid7": "1978-01-01"}]}
>
>
> but if I add the search with the accent:
>
>
> https://localhost/test/default/api_users/user/maï/lié/1978-01-01
>
>
>
>
> {"content": []}
>
>
>
>
> ??
>
> Le samedi 23 avril 2016 22:48:29 UTC+2, Mamisoa Andriantafika a écrit :
>>
>> Hi,
>>
>> Using this usual REST code in controller :
>>
>> def api_users():
>> response.view = 'generic.json' # or 'generic.' + request.extension
>> def GET(*args,**vars):
>> patterns = [
>> "/user[auth_user]",
>> "/user/{auth_user.id}",
>> "/user/{auth_user.id}/:field",
>>
>> "/user/{auth_user.first_name.contains}/{auth_user.last_name.contains}/{auth_user.dob_pid7.eq}"
>> ]
>> db.auth_user.created_by.readable = db.auth_user.modified_by.readable
>> = db.auth_user.created_on.readable = db.auth_user.modified_on.readable =
>> True
>> parser = db.parse_as_rest(patterns, args, vars)
>> data = parser.response
>> if parser.status == 200:
>> return dict(content=data)
>> else:
>> raise HTTP(parser.status, parser.error)
>>
>> with the last pattern, if I use character with accent e.g:
>>
>> /user/maït/lié
>>
>> the query do not find match as it is not interpreted as:
>>
>> "ma\u00eft" for first vars and
>> "li\u00e9" for the second vars
>>
>> which is the encoding I find when I do the request /user/ma/li .
>>
>> How can I correct the encoding transcription so that the request comply
>> to the format:
>>
>> /user/maï/lié
>>
>> ?
>>
>> Mike
>>
>>
>>
>> --
> 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 the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.