[web2py] Re: Reverse Proxy problem with grid form (bootstrap 3.x)

2015-09-20 Thread Daniel Vogel


Hi,

Some additional information. With older web2py versions (bootstrap 2.x) we 
have wrong sizing with the login behind reverse proxy (field has not the 
normal size).
With the new web2py version the problem is gone, but a new one appeared 
(see my first screen shot). I think it's a bug.



(Login field behind reverse proxy, bootstrap 2.x)

Thanks


Am Mittwoch, 9. September 2015 04:48:42 UTC+2 schrieb Daniel Vogel:
>
> Hi,
>
> I use web2py 2.12.3 with auth.wiki. In development mode, no problem with 
> HTML rendering. But behind a Apache reverse proxy in need some rules to 
> change HTML URL's.
>
> ProxyHTMLEnable On
> ProxyHTMLLinks imgsrc
> ProxyHTMLLinks ahref
>
> 
> Require all granted
> ProxyPass http://localhost:8000/eav
> ProxyPassReverse http://localhost:8000/
> ProxyHTMLURLMap http://localhost:8000/eav /eav
> 
>
> With this settings the grid form is deformed, the first search field is as 
> high as the display. If I remove the "ProxyHTMLURLMap", it's ok, but all 
> the img URL's has localhost:8000 in auth.wiki.
>
>
>
> 
>
>
>
> How can I fix this problem?
>
>
> Thanks
>
> 
>

-- 
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] Eclipse + Pydev + Docker - need suggestions

2015-09-20 Thread Kiran Subbaraman
Hello,
I need some help with understanding the best way to use Pydev with Eclipse, 
for web2py applications development. 
I have been working with web2py for the past year, and use the tools 
mentioned above for this purpose. Am trying to refine my understanding of 
this toolset, and if there is something more that can be done to improve 
the experience.

I use Eclipse IDE (Luna Service Release 2 - 4.4.2), with Pydev 
(4.3.0.201508182223), on Windows (10.0.10240), as my web2py development 
environment.

*Sorting out web2py imports*
I was looking at the documentation: 
http://web2py.com/books/default/chapter/29/14/other-recipes#Using-general-purpose-IDEs-with-web2py.
 
Went ahead and added the code to resolve imports:

if False:
from gluon import *
request = current.request
response = current.response
session = current.session
cache = current.cache
T = current.T


...It is probably wise to remove the import of the gluon debug module. 
> Also, to do this you should make the pydev project the web2py directory, 
> not your specific application.
>
> PyDev's git integration copes with this; it supports multiple git 
> repositories inside the one project directory structure.
>

I didn't quite understand what this means? It seems to suggest a means to 
debug applications from within Eclipse; can anyone elaborate on how to get 
this done. I can test it out, and contribute to improving the 
documentation. 


*Applications outside of web2py*
I also noticed this response from Massimo: 

Actually the web2py applications/ folder is not required to be under the 
> the web2py folder..


https://groups.google.com/d/msg/web2py/wi25qItKDEo/w-RbzvykRfcJ
So, I need to create a *web2py/options.py*, which has the property
folders = /web2py_applications #docker volume, for example

This will help me create web2py docker-containers, which point to my 
applications code outside of the containers. The applications themselves 
are in a git repository. Is this a setup that anyone has tried out before. 
I noticed this thread by Massimo, but that was inconclusive: 
https://groups.google.com/forum/#!searchin/web2py/docker/web2py/XhrfaYX00dg/6koPFbJWfNYJ
Any suggestions?

Thanks,
Kiran

-- 
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: Autocomplete widget don't respect other values in request.vars

2015-09-20 Thread Anthony
OK, scratch option #3.

On Sunday, September 20, 2015 at 9:34:00 AM UTC-4, Yoel Benitez Fonseca 
wrote:
>
> As Anthony suggested in the workarounds: 
>
> -- 
>
> city_widget = SQLFORM.widgets.autocomplete(request, db.city.name, 
> id_field=db.city.id) 
> city_widget.url = URL(args=request.args, vars=request.get_vars) 
> db.person.city.widget = city_widget 
> -- 
>
> turn to another problem, this is the content of request.vars for the 
> callback from autocomplete: 
>
>  
>
> It should be: 
>
>  
>
> As you can see, autocomplete just add his parameters to the url 
> assuming there are no other. 
>
> 2015-09-20 9:01 GMT-04:00, Yoel Benitez Fonseca : 
> > Thank's Antony for the replay, i'll create the issue. 
> > 
> > The error in the code come from my adaptation of the real code to the 
> > example posted in my original question. 
> > 
> > The reason I ask is because I have already taken account of these 
> > three possible workarounds and i think we can do better. 
> > 
> > 2015-09-19 16:09 GMT-04:00, Anthony : 
> >> It won't always be desirable to preserve the original query string 
> >> because 
> >> the Ajax callback is not really requesting the original parent page but 
> >> instead merely using the original action to access the autocomplete 
> >> functionality. However, it would probably be a good idea to add an 
> option 
> >> to the autocomplete widget allowing the query string to be preserved, 
> so 
> >> you should submit a github issue about this (link back to this thread). 
> >> 
> >> For now, though, there are three possible workarounds: 
> >> 
> >>1. Because the URL args are preserved, you can put the step in a URL 
> >> arg 
> >> 
> >>instead of a "step" variable in the query string. 
> >>2. You can store the step in the session rather than in the URL (not 
> >>good for bookmarking). 
> >>3. You can manipulate the widget after it has been instantiated 
> >> (haven't 
> >> 
> >>tried it, but I think it should work): 
> >> 
> >> city_widget = SQLFORM.widgets.autocomplete(request, 
> db.city.name, 
> >> id_field=db.city.id) 
> >> city_widget.url = URL(args=request.args, vars=request.get_vars) 
> >> db.person.city.widget = city_widget 
> >> 
> >> Also, note that there is an error in your code -- you are assigning the 
> >> widget to db.person.city rather than to db.person.city.widget. 
> >> 
> >> Anthony 
> >> 
> >> On Saturday, September 19, 2015 at 11:05:52 AM UTC-4, Yoel Benitez 
> >> Fonseca 
> >> wrote: 
> >>> 
> >>> hi! i have been struggling with a annoying bug, i got a this in a 
> >>> controller: 
> >>> 
> >>> --- 
> >>> def some_function(): 
> >>> if not request.vars.step: 
> >>> redirect(URL('some_function', vars=dict(step=1))) 
> >>> #  
> >>> # a lot of stuff in the middle 
> >>> #  
> >>> if request.vars.step = '3': 
> >>> db.person.city = SQLFORM.widgets.autocomplete(request, 
> >>> db.city.name, id_field=db.city.id) 
> >>> form = SQLFORM.factory(db.person): 
> >>> if form.process().accepted: 
> >>> # do some stuff 
> >>> pass 
> >>> # more stuff... 
> >>> --- 
> >>> 
> >>> The problem is that the autocomplete callback overwrite anything in 
> >>> request.vars and only left his own parameter _autocomplete_city_name, 
> >>> is this the intended behavior ? i mean for me it have more sense that 
> >>> the autocomplete callback add what it need and leave the others things 
> >>> in place. 
> >>> 
> >>> -- 
> >>> Msc. Yoel Benítez Fonseca 
> >>> Especialista en TI 
> >>> http://redevil.cubava.cu/ 
> >>> Tel.: (53 32)284701 
> >>> 
> >> 
> >> -- 
> >> 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. 
> >> 
> > 
> > 
> > -- 
> > Msc. Yoel Benítez Fonseca 
> > Especialista en TI 
> > http://redevil.cubava.cu/ 
> > Tel.: (53 32)284701 
> > 
>
>
> -- 
> Msc. Yoel Benítez Fonseca 
> Especialista en TI 
> http://redevil.cubava.cu/ 
> Tel.: (53 32)284701 
>

-- 
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] Strange error on scheduler

2015-09-20 Thread Leonardo Pires Felix
starting scheduler from widget for "gie"...
Currently running 1 scheduler processes
Processes started
Traceback (most recent call last):
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/shell.py", 
line 271, in run
exec(python_code, _env)
  File "", line 1, in 
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/scheduler.py", 
line 725, in loop
task = self.wrapped_pop_task()
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/scheduler.py", 
line 775, in wrapped_pop_task
db.commit()  # another nifty db.commit() only for Mysql
  File 
"/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/packages/dal/pydal/base.py"
, line 934, in commit
self._adapter.commit()
  File 
"/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/packages/dal/pydal/adapters/base.py"
, line 1328, in commit
return self.connection.commit()
OperationalError: Erro de SSL: decryption failed or bad record mac

Someone already had this error? What may be causing it?

-- 
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: Multi file upload

2015-09-20 Thread Luis Valladares
Hello! turns out that i've not handled it well from the server, so in 
changed my approach to this and worked flawlessly:

In the view:

 
  {{=T('Archivo')}} 
#1   
  {{=T('Descripción')}} 
#1Añadir otra foto  


The "añadir otra foto" button adds another field, with the formar foto_X 
descripcion_x where X is a consecutive number.

Later in the controller i do this:

 if var.startswith('foto_') and request.vars[var] != '':
uploaded = request.vars[var]descName = var.replace('foto', 
'descripcion')descripcion = request.vars[descName]  
  db.hoteles_fotos.insert(fk_hotel_id=id, 
descripcion=descripcion,
ruta=db.hoteles_fotos.ruta.store(uploaded.file, uploaded.filename))



El jueves, 13 de agosto de 2015, 13:25:06 (UTC-4:30), Val K escribió:
>
> Hi!
> It seems, that  your view has no  form-tag (i.e.   submit-button ...  so, I suppose,   it doesn't send anything at all! But 
> may be there are some mega-cool-js-hidden-magic? How it works?
> And if it works  web2py couldn't  process request.vars  with name like 
> "file[1]",  because request.vars is Storage-object (not array or list!) and 
> provide dot-property-notation  access, so request.vars.file[1] - 
> inadmissible
>
>
> On Wednesday, August 12, 2015 at 11:36:43 PM UTC+3, Luis Valladares wrote:
>>
>> Hello!
>>
>> I'm trying to create a form in order to upload multiple files with 
>> description for each file, i've something like this:
>>
>> View:
>> 
>>   
>>  
>>   {{=T('Archivo')}}
>>   
>> 
>>   
>>   
>>  
>>   {{=T('Descripción')}}
>>   > />
>> 
>>   
>>   
>>  
>>   {{=T('Archivo')}}
>>   
>> 
>>   
>>   
>>  
>>   {{=T('Descripción')}}
>>   > />
>> 
>>   
>>   
>>  
>>   {{=T('Archivo')}}
>>   
>> 
>>   
>>   
>>  
>>   {{=T('Descripción')}}
>>   > />
>> 
>>   
>> 
>>
>> Controller:
>> for archivo, descripcion in zip(form.vars.file, form.vars.description):
>> db.fotos.insert(
>> fk_id=id, descripcion=descripcion, ruta=archivo)
>>
>> But when i send this form i get this error: "> 'exceptions.TypeError'> zip argument #1 must support iteration"
>>
>> any suggestion? Thanks a lot 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] Re: Questions about authentication and authorization

2015-09-20 Thread Luis Valladares
After some discussion with my team we come with this architecture:

We will have a service to manage authentication and authorization, all our 
services will query him in order to get permission and credential, for 
authentication we will use CAS and for authorization RBAC over sended over 
JSON.

I've another question, exactly how CAS works? i mean, i know the theory 
that you log in the CAS provider and you will be logged in the CAS 
consumer, but how this works? with session cookies and a token? or how CAS 
communicate with the consumers

El lunes, 14 de septiembre de 2015, 21:54:30 (UTC-4:30), Luis Valladares 
escribió:
>
> Thanks for your answer!
>
> I've been reading about JWT too, and i consider it for application 
> authorization, the thing is i dont feel comfortable sending the parameters 
> through JSON, i prefer to send it via POST parameters and so, but after 
> reading the link you posted sounds like a good solution for app 
> authentication, and i will consider this along with Amazon approach and 
> OAuth2. The thing that is really bottering me is the authorization of 
> users. Any sugestion on this field?
>
> Thank you very much!
>
> El lunes, 14 de septiembre de 2015, 18:19:12 (UTC-4:30), Dave S escribió:
>>
>>
>>
>> On Monday, September 14, 2015 at 3:35:20 PM UTC-7, Luis Valladares wrote:
>>>
>>> Since i do the post i found some interesting articles, and now i have a 
>>> better implementation idea, but i'm still looking for the solution on a 
>>> subject. Here is what i have now:
>>>
>>> I will handle the authentication of my applications using the amazon 
>>> approach (
>>> http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/)
>>>  
>>> and the user authentication using CAS in order to centralize al the 
>>> services auth providers, but i'm still searching for a way to handle the 
>>> authorization for user, i read about Spring security but i didnt see any 
>>> implementation in python or web2py
>>>
>>> Again, thanks for any help!
>>>
>>
>> Perhaps Niphlod's JWT implementation would work for you, too.
>>
>> Quoting his example again:
>>
>>
>>> As per "original" demand of covering one-time-issued tokens, the "jti" 
>>> claim is the standard, and can be easily implemented, imagining to store 
>>> valid tokens in a database table:
>>>
>>> db.define_table('jwt_tokens', Field('token'), Field('user_id'), Field(
>>> 'inserted_on', 'datetime', default=request.now))
>>>
>>> def myadditional_payload(payload):
>>>  res = db(db.jwt_tokens.user_id == payload['user']['id']).select(
>>> orderby=~db.jwt_tokens.inserted_on).first()
>>>  payload['jti'] = res.token
>>>  return payload
>>>
>>> def mybefore_authorization(tokend):
>>>  res = db(
>>> (db.jwt_tokens.user_id == tokend['user']['id']) & 
>>> (db.jwt_tokens.token == tokend['jti'])
>>>  ).select().first()
>>>  if not res:
>>>  raise HTTP(400, u'Invalid JWT jti claim')
>>>
>>> myjwt = Web2pyJwt('secret', auth, 
>>>   additional_payload=additional_payload, 
>>>   before_authorization=mybefore_authorization)
>>>  
>>
>>
>> The list of features is in his post in the developer's forum.
>> > https://groups.google.com/d/msg/web2py-developers/dXfUrHNI5Sg/gqNa3kXsCQAJ
>> >
>>
>> If you need some background on JWT, my reading list recently included
>> https://self-issued.info/docs/draft-ietf-oauth-json-web-token.html>
>> (that's the standard as of May; it's actually readable by users of 
>> standards as well the writers, I think)
>>
>> /dps
>>
>>  
>>
>

-- 
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: Grid without consulting database

2015-09-20 Thread Luis Valladares
Sorry for the late response! i will test this ASAP

El viernes, 11 de septiembre de 2015, 13:48:56 (UTC-4:30), pjryan126 
escribió:
>
> I haven't tested any of this -- I would need a little time to put 
> something together, but I would attack the problem like this:
>
> 1. Create a Table object with appropriate fields and set migrate=False 
> (This creates a dummy table) 
> 2. Convert row values into a list of tuples
> 3. Use db._adapter.parse to create a DAL Rows object using the dummy table:
>
> t_rows = db._adapter.parse(rows, fields=[f for f in db.dummy_table], 
> colnames=db.dummy_table.fields)
>
>
> 4. Create a SQLFORM.grid in controller and then replace the rows with your 
> rows object using the DOM parser.
>
> grid = SQLFORM.grid(db.dummy_table)
> table = grid.element('.web2py_table')
> table[0] = t_rows
>
>
> On Thursday, September 10, 2015 at 6:50:49 PM UTC-4, Luis Valladares wrote:
>>
>> Well, that sounds like a big mess of db i/o, i think it will be better to 
>> use javascript. Maybe this can be put in a "wish list" for future 
>> development in web2py?
>>
>> Thanks for your help!
>>
>> El jueves, 10 de septiembre de 2015, 18:03:01 (UTC-4:30), Leonel Câmara 
>> escribió:
>>>
>>> Well there is, but, it's not pretty. You could create a DAL instance 
>>> using sqlite mem, then you put everything you get from the service there, 
>>> then you send a query in that DAL instance to the grid.  
>>>   
>>> Frankly, this is not a good idea and you'll probably run into problems, 
>>> you're better off using one of the many javascript grid options.
>>>
>>> Here are some options:
>>>
>>> http://handsontable.com/
>>> https://github.com/tonytomov/jqGrid/tree/master
>>> http://datatables.net/
>>>
>>> Or really just make it yourself it's really easy with stuff like 
>>> ractivejs or similar.
>>>  
>>>
>>

-- 
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] Polymer and SQLFORM

2015-09-20 Thread Luis Valladares
Hello!

I'm building a web2py site and i want to use polymer as my front-end 
"framework", as you may know polymer uses web elements with custom html 
tags, i mean, a input is something can be something like



I want to integrate this "feature" with the web2py SQLFORM module, after a 
bit of research i came with this approach, im not sure if its correct so i 
accept suggestion:

i've to override all the FormWidget class inside sqlhtml.py and modify all 
widget to generate a HTML output adapted to my custom tags, also create a 
custom formstyle related to polymer and maybe (and this is one of the 
problems i've found) create some sort of custom HTML helper for generating 
the HTML custom tags.

I think i miss a lot of changes needed for this to work well, so i am 
looking for opinions in this matter, i'm correct in my planning, or maybe 
there is a easier path to join SQLFORM and Polymer, or may be better to 
work without SQLFORM?

Thank for any help you can provide

-- 
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: Not Authorized exposing folders

2015-09-20 Thread Anthony
You're providing a relative file path. Instead, try:

import os
Expose(os.path.join(request.folder, 'albums'))

If the path is in a different application, you could do:

Expose(os.path.normpath(os.path.join(request.folder, '..', 'other_app', 
'albums')))

Anthony

On Sunday, September 20, 2015 at 7:58:47 AM UTC-4, Salvatore DI DIO wrote:
>
> Hello,
>
> I have a folder i would like to expose using 
>
> def index():
> f = myFolder()
>
> def myFolder():
> return dict(files=Expose(r'applications/welcome/albums'))
>
> I get 'NOT AUTHORIZED' message
>
> More, is it possible to share a folder outside of web2py folder ?
>
> Regards
>
>
>
>

-- 
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: crash - session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) on 2.9.11

2015-09-20 Thread Massimo Di Pierro
This is clearly a case of file being corrupted. If you remove your cache 
files does it happen again? Do you have a lot of traffic? What OS?

On Sunday, 20 September 2015 05:17:24 UTC-5, Dmitri Ermolaev wrote:
>
> session in cookies
>
> pickle error
> web2py™Version 2.11.2-stable+timestamp.2015.05.30.16.33.24PythonPython 
> 2.7.6: C:\Program Files (x86)\Apache Software 
> Foundation\Apache2.2\bin\httpd.exe (prefix: C:\Python27)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
>
> Traceback (most recent call last):
>   File "C:\web2py-m\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File "C:/web2py-m/applications/ipay3/controllers/default.py" 
> , line 264, in 
> 
>   File "C:\web2py-m\gluon\globals.py", line 412, in 
> self._caller = lambda f: f()
>   File "C:\web2py-m\gluon\cache.py", line 650, in wrapped_f
> rtn = cache_model(cache_key, lambda : func(), time_expire=time_expire)
>   File "C:\web2py-m\gluon\cache.py", line 465, in __call__
> item = self.storage.get(key)
>   File "C:\web2py-m\gluon\cache.py", line 419, in get
> return self[key]
>   File "C:\web2py-m\gluon\cache.py", line 359, in __getitem__
> value = pickle.load(val_file)
> EOFError
>
>

-- 
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: what can I do with this error: Getaadrinfo Failed.

2015-09-20 Thread Massimo Di Pierro
Please submit a bug report. Do you have any more detail about the error and 
the OS you are using to build and to run the exe code?

On Sunday, 20 September 2015 00:29:06 UTC-5, Maurice Waka wrote:
>
> When trying to custom pack and download my app as .exe, I get this error:
>
> [Errno socket error] [Errno 11004] getaddrinfo failed 
>
> How can I resolve it?
>

-- 
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: mail send

2015-09-20 Thread Massimo Di Pierro
I am not sure I filly understand. There is not mail.settings.to. "to" is a 
mandatory argument of mail.send(). 

On Saturday, 19 September 2015 03:03:44 UTC-5, Laer Cius wrote:
>
> Hi, 
>
> Le 18/09/2015 23:20, 黄祥 a écrit : 
> > hm, not sure, i get it, but i guess that you can use the query for 
> > that and pass it into mai.send(to=query result, ...). 
>
> Yes it's what I thought. 
>
> > another thing is, it seems i can't find mail.settings.to in web2py 
> > book. pls read the book about setup and sending emails 
> > e.g. from book 
>
> It's why I said it doesn't work : 
>
> mail.settings.to = db.auth_user.email_address (which is my field) 
> which does not work as mail.settings has no to attribute. 
>
>
> Thank you, kind regards, 
>
> -- 
> “One original thought is worth a thousand mindless quotings.” 
> “Le vrai n'est pas plus sûr que le probable.” 
>
>   Diogene Laerce 
>
>
>

-- 
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: Autocomplete widget don't respect other values in request.vars

2015-09-20 Thread Yoel Benitez Fonseca
As Anthony suggested in the workarounds:

--

city_widget = SQLFORM.widgets.autocomplete(request, db.city.name,
id_field=db.city.id)
city_widget.url = URL(args=request.args, vars=request.get_vars)
db.person.city.widget = city_widget
--

turn to another problem, this is the content of request.vars for the
callback from autocomplete:



It should be:



As you can see, autocomplete just add his parameters to the url
assuming there are no other.

2015-09-20 9:01 GMT-04:00, Yoel Benitez Fonseca :
> Thank's Antony for the replay, i'll create the issue.
>
> The error in the code come from my adaptation of the real code to the
> example posted in my original question.
>
> The reason I ask is because I have already taken account of these
> three possible workarounds and i think we can do better.
>
> 2015-09-19 16:09 GMT-04:00, Anthony :
>> It won't always be desirable to preserve the original query string
>> because
>> the Ajax callback is not really requesting the original parent page but
>> instead merely using the original action to access the autocomplete
>> functionality. However, it would probably be a good idea to add an option
>> to the autocomplete widget allowing the query string to be preserved, so
>> you should submit a github issue about this (link back to this thread).
>>
>> For now, though, there are three possible workarounds:
>>
>>1. Because the URL args are preserved, you can put the step in a URL
>> arg
>>
>>instead of a "step" variable in the query string.
>>2. You can store the step in the session rather than in the URL (not
>>good for bookmarking).
>>3. You can manipulate the widget after it has been instantiated
>> (haven't
>>
>>tried it, but I think it should work):
>>
>> city_widget = SQLFORM.widgets.autocomplete(request, db.city.name,
>> id_field=db.city.id)
>> city_widget.url = URL(args=request.args, vars=request.get_vars)
>> db.person.city.widget = city_widget
>>
>> Also, note that there is an error in your code -- you are assigning the
>> widget to db.person.city rather than to db.person.city.widget.
>>
>> Anthony
>>
>> On Saturday, September 19, 2015 at 11:05:52 AM UTC-4, Yoel Benitez
>> Fonseca
>> wrote:
>>>
>>> hi! i have been struggling with a annoying bug, i got a this in a
>>> controller:
>>>
>>> ---
>>> def some_function():
>>> if not request.vars.step:
>>> redirect(URL('some_function', vars=dict(step=1)))
>>> # 
>>> # a lot of stuff in the middle
>>> # 
>>> if request.vars.step = '3':
>>> db.person.city = SQLFORM.widgets.autocomplete(request,
>>> db.city.name, id_field=db.city.id)
>>> form = SQLFORM.factory(db.person):
>>> if form.process().accepted:
>>> # do some stuff
>>> pass
>>> # more stuff...
>>> ---
>>>
>>> The problem is that the autocomplete callback overwrite anything in
>>> request.vars and only left his own parameter _autocomplete_city_name,
>>> is this the intended behavior ? i mean for me it have more sense that
>>> the autocomplete callback add what it need and leave the others things
>>> in place.
>>>
>>> --
>>> Msc. Yoel Benítez Fonseca
>>> Especialista en TI
>>> http://redevil.cubava.cu/
>>> Tel.: (53 32)284701
>>>
>>
>> --
>> 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.
>>
>
>
> --
> Msc. Yoel Benítez Fonseca
> Especialista en TI
> http://redevil.cubava.cu/
> Tel.: (53 32)284701
>


-- 
Msc. Yoel Benítez Fonseca
Especialista en TI
http://redevil.cubava.cu/
Tel.: (53 32)284701

-- 
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: Autocomplete widget don't respect other values in request.vars

2015-09-20 Thread Yoel Benitez Fonseca
Thank's Antony for the replay, i'll create the issue.

The error in the code come from my adaptation of the real code to the
example posted in my original question.

The reason I ask is because I have already taken account of these
three possible workarounds and i think we can do better.

2015-09-19 16:09 GMT-04:00, Anthony :
> It won't always be desirable to preserve the original query string because
> the Ajax callback is not really requesting the original parent page but
> instead merely using the original action to access the autocomplete
> functionality. However, it would probably be a good idea to add an option
> to the autocomplete widget allowing the query string to be preserved, so
> you should submit a github issue about this (link back to this thread).
>
> For now, though, there are three possible workarounds:
>
>1. Because the URL args are preserved, you can put the step in a URL arg
>
>instead of a "step" variable in the query string.
>2. You can store the step in the session rather than in the URL (not
>good for bookmarking).
>3. You can manipulate the widget after it has been instantiated (haven't
>
>tried it, but I think it should work):
>
> city_widget = SQLFORM.widgets.autocomplete(request, db.city.name,
> id_field=db.city.id)
> city_widget.url = URL(args=request.args, vars=request.get_vars)
> db.person.city.widget = city_widget
>
> Also, note that there is an error in your code -- you are assigning the
> widget to db.person.city rather than to db.person.city.widget.
>
> Anthony
>
> On Saturday, September 19, 2015 at 11:05:52 AM UTC-4, Yoel Benitez Fonseca
> wrote:
>>
>> hi! i have been struggling with a annoying bug, i got a this in a
>> controller:
>>
>> ---
>> def some_function():
>> if not request.vars.step:
>> redirect(URL('some_function', vars=dict(step=1)))
>> # 
>> # a lot of stuff in the middle
>> # 
>> if request.vars.step = '3':
>> db.person.city = SQLFORM.widgets.autocomplete(request,
>> db.city.name, id_field=db.city.id)
>> form = SQLFORM.factory(db.person):
>> if form.process().accepted:
>> # do some stuff
>> pass
>> # more stuff...
>> ---
>>
>> The problem is that the autocomplete callback overwrite anything in
>> request.vars and only left his own parameter _autocomplete_city_name,
>> is this the intended behavior ? i mean for me it have more sense that
>> the autocomplete callback add what it need and leave the others things
>> in place.
>>
>> --
>> Msc. Yoel Benítez Fonseca
>> Especialista en TI
>> http://redevil.cubava.cu/
>> Tel.: (53 32)284701
>>
>
> --
> 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.
>


-- 
Msc. Yoel Benítez Fonseca
Especialista en TI
http://redevil.cubava.cu/
Tel.: (53 32)284701

-- 
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] Not Authorized exposing folders

2015-09-20 Thread Salvatore DI DIO
Hello,

I have a folder i would like to expose using 

def index():
f = myFolder()

def myFolder():
return dict(files=Expose(r'applications/welcome/albums'))

I get 'NOT AUTHORIZED' message

More, is it possible to share a folder outside of web2py folder ?

Regards



-- 
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: crash - session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) on 2.9.11

2015-09-20 Thread Dmitri Ermolaev

pickle error
web2py™Version 2.11.2-stable+timestamp.2015.05.30.16.33.24PythonPython 
2.7.6: C:\Program Files (x86)\Apache Software 
Foundation\Apache2.2\bin\httpd.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

Traceback (most recent call last):
  File "C:\web2py-m\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "C:/web2py-m/applications/ipay3/controllers/default.py" 
, line 264, in 

  File "C:\web2py-m\gluon\globals.py", line 412, in 
self._caller = lambda f: f()
  File "C:\web2py-m\gluon\cache.py", line 650, in wrapped_f
rtn = cache_model(cache_key, lambda : func(), time_expire=time_expire)
  File "C:\web2py-m\gluon\cache.py", line 465, in __call__
item = self.storage.get(key)
  File "C:\web2py-m\gluon\cache.py", line 419, in get
return self[key]
  File "C:\web2py-m\gluon\cache.py", line 359, in __getitem__
value = pickle.load(val_file)
EOFError

-- 
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] 3 field validator

2015-09-20 Thread Annet
I've got the following table definition.

def set_requirement(edg_edge): db.edg_edge.label.requires=[IS_IN_DB(db_st, 
'st_edge_label.name', '%(name)s', zero=T("Select a value")), 
IS_NOT_IN_DB(db((db.edg_edge.fromID==request.vars.fromID) & 
(db.edg_edge.toID==request.vars.toID)), db.edg_edge.label, 
error_message='Realtie al in database')]

db.define_table('edg_edge',
Field('fromID', 'reference vtx_vertex', default='', 
requires=[IS_IN_DB(db, 'vtx_vertex.id', '%(name)s', zero=T("Select a 
value"))], notnull=True),
Field('toID', 'reference vtx_vertex', default='', 
requires=[IS_IN_DB(db, 'vtx_vertex.id', '%(name)s', zero=T("Select a 
value"))], notnull=True'),
Field('label', length=128, default='', notnull=True, 
widget=SQLFORM.widgets.options.widget),
on_define = set_requirement,
migrate = False)

To prevent the user form entering the same edge twice I defined the 3 field 
validator. However it does not
work and I do not see what's wrong with my code.

The user can enter:

fromIDtoIDlabel

2 3 sponsor
2 3 sponsor

which the validator should prevent.


Kind regards,

Annet

-- 
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.