Re: [web2py] web2py.com seams down

2015-12-09 Thread Massimiliano
It’s up for me.

On Wed, Dec 9, 2015 at 10:54 AM, Manuele Pesenti 
wrote:

> Just tried to access web2py web site but it seams unreachable... anybody
> else got the same result?
>
> M.
>
> --
> 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.
>



-- 
Massimiliano

-- 
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 seams down

2015-12-09 Thread Manuele Pesenti
Just tried to access web2py web site but it seams unreachable... anybody
else got the same result?

M.

-- 
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: Contribution to validators

2015-12-09 Thread Pierre-Antoine Roiron
I seems like I forgot to add IS_TITLE() to the __all__ declaration or 
whatever is its name in validators.py (I am not an developer, sorry for the 
inapropriate vocabulary). It seems to work for now.

I am still open to some explanations (what is validators.pyc).

-- 
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] use case: user login on android

2015-12-09 Thread noam cohen




Hi
I need help implementing this scenario:

user opens the android app. 
app checks if he is currently logged in. 
if not, open the login web page ( in a webview - as seen in the screenshot)
from here, new users can register.
user enter credentials.
login result (pass/fail) is used by the app logic to decide how to 
continue. 
The user SHOULD not have to see web pages outside the application (i.e. 
opening the browser)
Once the user is logged in, he updates the web2py server with the 
equivalent of c -> s :  foo(user_id, data1,data2)


   1. how can I check if user is currently logged in? I saw the session 
   cookie but not sure how to infer from it the status. Also, a user could 
   have logged in long time ago, have the cookie but the session will expire. 
   I guess something like this is needed in controllers/hello.py: ( i.e. start 
   by sending GET http://mysite/my_app/hello/logged
   @auth.requires_login()
   def logged(): return dict(message="hello logged user")
   2. I guess I don't really need the user_id field in the client side. 
   What is the proper way to get actions associated with this user? in other 
   words, each user has database updates relevant only for him.



This is similar to 
https://groups.google.com/forum/?fromgroups#!searchin/web2py/login/web2py/22hXvhMF-ws/gEb62ZJMabEJ
 but 
not exactly.

Once I have it working, I will upload the java class to the web2py splices.

thanks!
Noam

-- 
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: use case: user login on android

2015-12-09 Thread Anthony

>
>
>1. how can I check if user is currently logged in? I saw the session 
>cookie but not sure how to infer from it the status. Also, a user could 
>have logged in long time ago, have the cookie but the session will expire. 
>I guess something like this is needed in controllers/hello.py: ( i.e. 
> start 
>by sending GET http://mysite/my_app/hello/logged
>@auth.requires_login()
>def logged(): return dict(message="hello logged user")
>
> Something like this seems reasonable. 

>
>1. I guess I don't really need the user_id field in the client side. 
>What is the proper way to get actions associated with this user? in other 
>words, each user has database updates relevant only for him.
>
> The web2py Auth system is designed to check roles and permissions on the 
server, so just make requests and have web2py do the checking (possibly 
returning not-authorized messages when necessary). You could return a list 
of roles or permissions to the app if needed, but you would still want to 
do the final authorization checks in web2py. Note, a list of the user's 
group memberships can be found in auth.user_groups (there is no similar 
automatically compiled list of permissions, so you would have to construct 
that based on the details of your app if you are using the permissions 
functionality).

Anthony

-- 
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: Static files inside of folder with spaces (url encoding)

2015-12-09 Thread Anthony
Are you serving web2py via the built-in server? If not, you can configure 
your web server (e.g., nginx or Apache) to server static files directly.

Anthony

On Wednesday, December 9, 2015 at 2:35:16 AM UTC-5, Jaime Sempere wrote:
>
> Hi,
>
> I am trying to put some files inside of folder with a space (i.e: 
> static/my things/), but I am not been able to handle on web2p, when I try 
> to access the files on that folder. 
>
> It doesn't matter  how I encode the url (I tried to replace the ' ' for 
> '%20') it keeps saying 'invalid request'. 
>
> I have read that web2py does not like spaces in folder... so is this a 
> 'bug' known and 'accepted' or is there any workaround to handle this?
>
> Thanks in advance
>
> PS: I am working on a music project, each folder will be an album (for 
> example 'Abbey Road'), and inside of this folder I will have the files. I 
> would like to copy/paste folders without editing spaces. Plus, I would use 
> the folder's name to feed the database.
>

-- 
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: Retrieve record field labels in sqlform.grid custom view

2015-12-09 Thread Gael Princivalle
>Is there a reason you can't just do db.memos.code.label?
Sorry Anthony, I can just do db.memos.code.label, thanks.

Il giorno domenica 29 novembre 2015 20:49:55 UTC+1, Anthony ha scritto:
>
> Can you provide more details regarding what you are trying to do? Is there 
> a reason you can't just do db.memos.code.label? Anyway, if a create, 
> update, or view form has been requested, the associated SQLFORM objects can 
> be found in grid.create_form, grid.update_form, and grid.view_form, 
> respectively. At that point, it is just a regular SQLFORM, so you can 
> access all the usual attributes, such as grid.view_form.custom.label.code.
>
> Anthony
>
> On Sunday, November 29, 2015 at 12:52:30 PM UTC-5, Gael Princivalle wrote:
>>
>> Hello everybody.
>>
>> Is there a way in a sqlform.grid to retrieve record field labels in a 
>> custom view?
>> Something like that:
>> grid.view_form.record.code.label
>>
>> To retrieve:
>> db.define_table('memos',
>> Field('code', type='string', requires=IS_NOT_EMPTY(), label='*Codice*
>> '),
>>
>> Thanks, 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: web2py resources

2015-12-09 Thread Matheus Cardoso
I just asked if there was one place to gather resources about web2py and 
when Richard shared some similiar thoughts, I did a search on github and a 
quick search on Google and couldn't nothing related (web2slices I already 
know, but I'll get there), even www.web2pyref.com. So I created a 
repository to start something about it. I think web2slices is outdated, not 
friendly and a bit messy. I get more good solutions from stackoverflow or 
source code rather search something on there. My envision is build 
something like:

   - https://github.com/vinta/awesome-python 
   - https://github.com/vsouza/awesome-ios
   - Or https://github.com/juarezpaf/ionic-adventures

But if community thinks that web2ref is the way to go or start, so let's do 
it, but we have to spread the word and make it really open to 
collaboration. 

On Monday, April 30, 2012 at 4:49:41 PM UTC-3, Anthony wrote:
>
> Most web2py resources can be found on web2py.com, but here are some 
> Google Groups topics identifying additional resources:
>
> web2py help & resources 
> 
> Plugins 
> 
> Signature apps 
> 
> Featured web2py apps 
> 
> web2py hosting 
> 
>

-- 
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] web2py.com seams down

2015-12-09 Thread Manuele Pesenti
Il 09/12/15 10:56, Massimiliano ha scritto:
> It’s up for me.
yes it's back even for me now.
Thanks

Manuele

-- 
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: Embed pdf and file download

2015-12-09 Thread Gael Princivalle
Thanks a lot Leonel. I have integrated the pdf.js like Mark have done 
(thanks Mark).
I've got some troubles also with pdf.js. With block center in the layout 
file pdf was not displayed.
{{block center}}
{{include}}
{{end}}

Without, pdf is displayed.
We talk about a custom grid view.
I've to test it but I can imagine that it's the same with your solution, 
pdf HTML5 object.

One thing that seems pdf.js do better is displaying pdf on mobile devices. 
Almost with my Android mobile phone pdf are displayed. With pdf HTML5 
object no.

Il giorno lunedì 30 novembre 2015 20:15:46 UTC+1, Leonel Câmara ha scritto:
>
> Here's my test application which is working for me. To test I simply 
> introduced a memo pdf file in appadmin.
>

-- 
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] launch web2py from python interpreter

2015-12-09 Thread Richard Vézina
I guess I will fallback with that solution... It is more fonctional
testing... I actually remix Vinicius web2py.test example...

Thanks

Richard

On Tue, Dec 8, 2015 at 3:39 PM, Anthony  wrote:

> You probably don't want to run tests by making HTTP calls to web2py
> running behind a web server (unless doing functional testing, in which
> case, just start up the built-in server from the command line and then run
> your tests -- which you can automate with a shell script). Instead, you can
> run tests in the context of a web2py environment (much like the environment
> that is constructed in the web2py shell). For an example specifically using
> py.test, check out https://github.com/viniciusban/web2py.test, in
> particular,
> https://github.com/viniciusban/web2py.test/blob/master/tests/conftest.py#L85
> .
>
> Anthony
>
>
> On Tuesday, December 8, 2015 at 3:12:21 PM UTC-5, Richard wrote:
>>
>> I would like to start web2py rocket instance like what we can do with
>> command line python web2py.py -S appname -M, but from python interpreter.
>>
>> So, I can start web2py instance when I launch my test run from my test
>> runner script... So I don't have to make sure there is a web2py instance
>> running and I can launch test run in the background...
>>
>> Richard
>>
>> On Tue, Dec 8, 2015 at 2:38 PM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> Not sure what you mean. web2py is a collection of pyhton modules. You
>>> can import them and use them as any pyhton module.
>>>
>>> >>> import sys
>>> >>> sys.append('/path/to/web2py')
>>> >>> from gluon.html import DIV, SPAN
>>> >>> print DIV('hello',SPAN('world'))
>>>
>>> for your convenience we provide a custom shell (like ipython does) which
>>> works as if you were inside an app:
>>>
>>> python web2py.py -S appname -M
>>> >>> print db.tables
>>>
>>>
>>> On Tuesday, 8 December 2015 09:23:24 UTC-6, Richard wrote:

 Hello,

 Is there a way to launch web2py from within python interpreter?

 Like pytest :
 https://pytest.org/latest/usage.html#calling-pytest-from-python-code
 

 Thanks

 Richard

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

-- 
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: Using apsw with web2py

2015-12-09 Thread Jitun John
Thanks a lot Massimo Di Pierro, Its working great.
I wanted to make an .exe of the application, so I added to 
web2py/applications/yourapp/modules/
I kind of figured out how to use DAL with similar functionality. 
So I will play with both settings.


On Tuesday, December 8, 2015 at 10:43:43 AM UTC+5:30, Massimo Di Pierro 
wrote:
>
> You can definitively do that. You can use any module that works with 
> python with web2py. You just have to make some choices about whether you 
> want to distribute your module with your app or not.
>
> If you do not want to distribute it with your app:
> - If you run web2py from source you can put it into the normal python 
> site-packages
> - if you run web2py binary, you have to put your module in 
> web2py/site-packages
>
> If you do want to distribute it with your app, then it is a web2py 
> specific logic.
> - you have to put it into web2py/applications/yourapp/modules/ and you 
> still import with "import modulename".
> Not all modules can be distributed distributed in 
> web2py/applications/yourapp/modules/. Only modules that do not assume they 
> are in site-packages and use relative import.
>
> Massimo
>
>
>
> On Monday, 7 December 2015 17:03:36 UTC-6, Jitun John wrote:
>>
>>
>> Hi I am an amateur programmer and new to web2py.
>>
>> I have written python scripts with apsw imported. (
>> http://rogerbinns.github.io/apsw/)
>> It allows me to create a db in the memory and once all 
>> processing/insertion is done, one can backup the date to an .sqlite file on 
>> the disk.
>> This .sqlite file can be read and loaded into the memory at some later 
>> point in time as well.
>> I was wondering if I can import apsw into web2py module .py (apsw works 
>> with python 2.x)
>> At present I get "Cannot import module applications.admin.modules.apsw"
>>
>> mem_db_connection = apsw.Connection(":memory:")
>> cursor = mem_db_connection.cursor()
>>
>> # Copy from memory to file
>> with global_db_backup_con.backup("main", mem_db_connection, "main") 
>> as backup:
>> backup.step()   # copy whole database in one go
>>
>> If not, then is there anything similar I can use in web2py ?
>> I plan to make a simple log analysis app which runs on locally on clients 
>> unit.
>>
>

-- 
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: Static files inside of folder with spaces (url encoding)

2015-12-09 Thread Jaime Sempere
Yes, that's my problem the web2py server looks like he is not able to 
handle spaces on static paths to access those files... any other advice?


El miércoles, 9 de diciembre de 2015, 14:31:36 (UTC+1), Anthony escribió:
>
> Are you serving web2py via the built-in server? If not, you can configure 
> your web server (e.g., nginx or Apache) to server static files directly.
>
> Anthony
>
>>
>>

-- 
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] Porblem with customized login

2015-12-09 Thread Annet
I have the following default/user function:

auth.settings.login_onaccept = lambda form: __on_login()
auth.settings.logout_onlogout = lambda user: __on_logout()

def user():
form = auth()

if request.args(0) == 'login':
if request.vars.setting == 'on_failed_authentication':
get_flash(response, messages_authentication_failed, 'warning', 
'custom')

elif request.args(0)=='not_authorized':
get_flash(session, auth.messages.access_denied, 'warning', 'custom')
if auth.is_logged_in():
redirect(URL('index'))
else:
redirect(URL('user', args='login'))

return dict(form=form)

__on_login builds a customized menu,  stores some variables in session and 
sets
a custom log_out message session.messages_logged_out

all on_logout does is:

auth.messages.logged_out = session.messages_logged_out


When a user is logged in and his session expires he is being redirect to 
default/user/login,
after proving his username and password, a flash displays the 
auth.messages.logged_out
and the login form. After proving his username and password again the user 
is logged in.


I don't see why the customizations I made interfere with web2py's access 
control,
I hope one of you does.


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.


[web2py] web2py - on ubuntu 12.04 vps.net

2015-12-09 Thread dirman
i just install web2py on ubuntu 12.04 on vps.net server but can't route to 
web2py

this is what i am getting from Apache instead of the web2py welcome app

It works! 

This is the default web page for this server.

The web server software is running but no content has been added, yet.


 i need 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: web2py - on ubuntu 12.04 vps.net

2015-12-09 Thread Anthony
Did you follow the deployment instructions for Apache: 
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Apache-setup

On Wednesday, December 9, 2015 at 11:09:09 AM UTC-5, dirman wrote:
>
> i just install web2py on ubuntu 12.04 on vps.net server but can't route 
> to web2py
>
> this is what i am getting from Apache instead of the web2py welcome app
>
> It works! 
>
> This is the default web page for this server.
>
> The web server software is running but no content has been added, yet.
>
>
>  i need 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.


Re: [web2py] Re: problem while adding a radio button in login form

2015-12-09 Thread Richard Vézina
What about setting 2 ldap authentication ?

In web2py you can login with multiple login methods and web2py use them in
the order they are specified in auth.settings.login_methods... If password
fail for one it tries with the other...

Here my settings :
auth.settings.login_methods = \
[auth,
 ldap_auth(...)]

You may try just to do :
auth.settings.login_methods = \
[ldap_auth(...),
 ldap_auth(...)]

You define you 2 differents ldap servers...

Richard



On Tue, Dec 8, 2015 at 4:19 PM, Jonathan R  wrote:

> I have two distinct sources of authentication ( 2 ldap servers) and I use
> the credentials provided by the user to perform the query that gather
> information on the ldap server on which the user is authenticated.
> In an effort to follow the DRY concept my function that gather information
> can query both server and chose the correct one by using a boolean set to
> True for one server and False for the other.
> I asked another question on this group about the best way to determine
> which auth_method was successful (when using
> auth.settings.auth_methods[auth_ldap(server 1), auth_ldap(server2)]) but no
> one has provided an answer yet.
> That let me with the present option to customize the login form to let the
> user chose on which server launch the query.
>
> I asked about the variable storing the value before processing the form
> because I was exploring on the jQuery side ( onchange event) which doesn't
> seems to be able to do the job.
>
> I hope I clarified the situation :p
>
> On Tuesday, December 8, 2015 at 3:18:04 PM UTC-5, Richard wrote:
>>
>> :)
>>
>> For what...
>>
>>
>>
>> On Tue, Dec 8, 2015 at 2:18 PM, Jonathan R  wrote:
>>
>>> I need to have this radio button,
>>> is there a variable that stores the value of the radio button before
>>> processing the form ?
>>>
>>> On Tuesday, December 8, 2015 at 11:03:40 AM UTC-5, Richard wrote:

 You should have a look at web2py auth... I guess no one really need to
 customize login form... There is surely a way to customize it, and you
 seems to have found a way... You may also, ask yourself about why you do
 that and if you really need to do it... Or could it be crafted
 differently... For instance would your user really want to change setting
 at each login?? Maybe you can have a preference profile page for each user
 to them set there prefered way of login...

 Richard

 On Tue, Dec 8, 2015 at 10:56 AM, Jonathan R  wrote:

> Yes I did, and nothing changed on the login screen, I still had None
> displayed instead of the radio button.
>
> I feel like there is a simple easy way to add a field in the login
> screen and save it but I can't see it...
>
>
>
>
> On Monday, December 7, 2015 at 9:42:51 PM UTC-5, Richard wrote:
>>
>> Did you try by simply specify :
>>>
>>> Field('radio_button', ..., readable=True, writable=True)
>>>
>>
>> ?
>>
>> Richard
>>
>> On Mon, Dec 7, 2015 at 5:19 PM, Jonathan R  wrote:
>>
>>> I successfully added the radio button i wanted on my login page but
>>> instead of using a column in the auth_user table I only created a radio
>>> button that will assign its value in a session variable. To do so I 
>>> need to
>>> modify the if form.accepts(): block to gather the value on submission 
>>> but
>>> I'm not sure where to find this piece of code (or what should be in a
>>> custom one to keep the authentication process working).
>>>
>>> my default.py :
>>> user():
>>>
>>> if request.args(0)== "login":
>>> form=auth()
>>> form.elements()[0].insert(0,LABEL('text1',_class='radioButton'))
>>>
>>> form.elements()[0].insert(0,INPUT(_type='radio',_class='radioButton',_value='text1'))
>>> #same for all values
>>>
>>> #frest of the form (username and password) same as Richard
>>> implementation
>>>
>>> return dict(form=form)
>>>
>>> [...]
>>>
>>> then if I want to gather the data in a session variable I'll have to
>>> change the behavior of the auth() form on accepts:
>>>
>>> if form.accepts(request,session):
>>> session.radioButtonValue = form.vars.radioButton
>>>
>>> but this will stop the auth to process the rest of the form but I
>>> don't know what are the mandatory steps to add (couldn't locate the
>>> original auth accepts process)
>>>
>>>
>>>
>>> On Friday, December 4, 2015 at 4:45:52 PM UTC-5, Jonathan R wrote:

 Hi everyone,
 I'm trying to add a radio button on my login form to let the user
 decide which authentication method he wants to use.

 I added a field in the auth_user table and i try to display the
 corresponding radio button in my login page as follow:

 

[web2py] Re: Porblem with customized login

2015-12-09 Thread Anthony
I'm not sure I follow exactly what is going on, but note that with form = 
auth(), all the login logic is handled inside of auth(), including any 
redirects -- so the code may never get past that line.

Also, as an aside, if you define your callback functions to accept a single 
argument (even though you won't use the argument), you don't have to wrap 
them in lambdas.

Anthony

On Wednesday, December 9, 2015 at 9:26:31 AM UTC-5, Annet wrote:
>
> I have the following default/user function:
>
> auth.settings.login_onaccept = lambda form: __on_login()
> auth.settings.logout_onlogout = lambda user: __on_logout()
>
> def user():
> form = auth()
>
> if request.args(0) == 'login':
> if request.vars.setting == 'on_failed_authentication':
> get_flash(response, messages_authentication_failed, 'warning', 
> 'custom')
>
> elif request.args(0)=='not_authorized':
> get_flash(session, auth.messages.access_denied, 'warning', 
> 'custom')
> if auth.is_logged_in():
> redirect(URL('index'))
> else:
> redirect(URL('user', args='login'))
>
> return dict(form=form)
>
> __on_login builds a customized menu,  stores some variables in session and 
> sets
> a custom log_out message session.messages_logged_out
>
> all on_logout does is:
>
> auth.messages.logged_out = session.messages_logged_out
>
>
> When a user is logged in and his session expires he is being redirect to 
> default/user/login,
> after proving his username and password, a flash displays the 
> auth.messages.logged_out
> and the login form. After proving his username and password again the user 
> is logged in.
>
>
> I don't see why the customizations I made interfere with web2py's access 
> control,
> I hope one of you does.
>
>
> 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.


[web2py] Re: web2py - on ubuntu 12.04 vps.net

2015-12-09 Thread Pierre-Antoine Roiron
This script is for ubuntu 14.04, not 12.04. Nothing stroke me but I could be 
missing something. Did you try 
sudo service apache2 restart

-- 
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: Embed pdf and file download

2015-12-09 Thread Gael Princivalle
I think the best solution is to use the actual version of pdf.js, that 
offer more functions to the user (zoom...) and perhaps will avoid some 
incompatibilities. For example pdf files saved by the Windows 10 scan 
software are not read by the pdf.js version that have used Mark.

-- 
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 - on ubuntu 12.04 vps.net

2015-12-09 Thread Pierre-Antoine Roiron
Did it returned any error or warning while executing?

-- 
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 - on ubuntu 12.04 vps.net

2015-12-09 Thread Pierre-Antoine Roiron
Did it returned any error or warning while executing?

-- 
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: Bug / Dumb Question a = b= []

2015-12-09 Thread Ron McOuat
Are you sure you want to do that?

a = b = []

binds a and b to the same empty list object so whatever you do to a will 
also appear in b because they both reference the same list object. 
Assignment does not create a new object, it simply binds a variable name on 
the left to the object on the right.

Try this:

a = b = []
a.insert(0,2)
print a, b

should print
[2] [2]

A great source of bugs if a and b are thought to be different objects.

Ron

On Tuesday, 8 December 2015 07:01:36 UTC-8, Mark Billion wrote:
>
> in python 2.6, I can run a = b = [] and get the expected result.  In W2P, 
> when I do it, it throws an exception as the list does not propagate to both 
> a & b.  It would make my code cleaner, but otherwise not a problem.  Just 
> wanted to give a shout in case anyone gave a 
>
> Thanks again for all of 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: web2py - on ubuntu 12.04 vps.net

2015-12-09 Thread Pierre-Antoine Roiron
Cam you check that default.conf is in /etc/apache2/site-enable/, and that it 
contains references to web2py?

-- 
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: Bug / Dumb Question a = b= []

2015-12-09 Thread Richard Vézina
Python idiom should be : a, b = [], []

I remember having learn that in an presentation about idiomatic python, in
this presentation I think :
https://www.youtube.com/watch?v=OSGv2VnC0go=WL=14

:)

Richard

On Wed, Dec 9, 2015 at 3:25 PM, Ron McOuat  wrote:

> Are you sure you want to do that?
>
> a = b = []
>
> binds a and b to the same empty list object so whatever you do to a will
> also appear in b because they both reference the same list object.
> Assignment does not create a new object, it simply binds a variable name on
> the left to the object on the right.
>
> Try this:
>
> a = b = []
> a.insert(0,2)
> print a, b
>
> should print
> [2] [2]
>
> A great source of bugs if a and b are thought to be different objects.
>
> Ron
>
>
> On Tuesday, 8 December 2015 07:01:36 UTC-8, Mark Billion wrote:
>>
>> in python 2.6, I can run a = b = [] and get the expected result.  In W2P,
>> when I do it, it throws an exception as the list does not propagate to both
>> a & b.  It would make my code cleaner, but otherwise not a problem.  Just
>> wanted to give a shout in case anyone gave a 
>>
>> Thanks again for all of 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.
>

-- 
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] Pyodel announcement

2015-12-09 Thread Richard D
Hi,

Some years ago a discussion took place about a LMS. Since then Alan Etkin 
has created Pyodel.
I contacted Alan and decided to take this project forward.

A Github repo https://github.com/RichDijk/pyodel is created for code 
management.

This is the initial version which is exact like the last version from the 
Google code repo.

A Google group has been created for 
collaboration https://groups.google.com/forum/#!forum/pyodel

My idea is to create designs and builds of small parts. Because of this 
Pyodel will not be fully functional for quite a while, parts will be 
perfect.
A major challange is the content format. Will we use SCORM, rest of a new 
JSON based format?

Hope to see you on Pyodel.

Richard Dijkstra

-- 
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: Bug / Dumb Question a = b= []

2015-12-09 Thread Richard Vézina
Around 33 minutes...

On Wed, Dec 9, 2015 at 3:45 PM, Richard Vézina 
wrote:

> Python idiom should be : a, b = [], []
>
> I remember having learn that in an presentation about idiomatic python, in
> this presentation I think :
> https://www.youtube.com/watch?v=OSGv2VnC0go=WL=14
>
> :)
>
> Richard
>
> On Wed, Dec 9, 2015 at 3:25 PM, Ron McOuat  wrote:
>
>> Are you sure you want to do that?
>>
>> a = b = []
>>
>> binds a and b to the same empty list object so whatever you do to a will
>> also appear in b because they both reference the same list object.
>> Assignment does not create a new object, it simply binds a variable name on
>> the left to the object on the right.
>>
>> Try this:
>>
>> a = b = []
>> a.insert(0,2)
>> print a, b
>>
>> should print
>> [2] [2]
>>
>> A great source of bugs if a and b are thought to be different objects.
>>
>> Ron
>>
>>
>> On Tuesday, 8 December 2015 07:01:36 UTC-8, Mark Billion wrote:
>>>
>>> in python 2.6, I can run a = b = [] and get the expected result.  In
>>> W2P, when I do it, it throws an exception as the list does not propagate to
>>> both a & b.  It would make my code cleaner, but otherwise not a problem.
>>> Just wanted to give a shout in case anyone gave a 
>>>
>>> Thanks again for all of 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.
>>
>
>

-- 
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: Error db._adapter

2015-12-09 Thread Hector Chacon
good afternoon, I explain how to solve the problem in question, so that the 
method ".executesql" the DAL object fails with the message "'NoneType' 
object is not iterable" the problem is that when you run a stored 
procedure, the method attempts to obtain the return of the execution of the 
sentence sent to the database, then it is as simple as: A- if you want to 
return a set of rows to Deberas controller indicate that the return control 
it as an option "as_dict = True" dictionary, after that make sure that what 
you return to controlled from the execution is to iterate (cols/rows), bone 
containing rows and columns and use it to something that outcome. B- if 
your store procedure executes X DML statements, including update, insert, 
delete program and try them, takes control of execution in the stored 
procedure or function and do not send data to the controller, do the 
procedure marrow own your environment, if return data you require to 
control "ZZZ" reasons, then make a new call to the stored procedure or 
SELECT statement and controls conceptually the same as I explain in the 
clarification "A".

not mix execute a procedure to send data from a procedure.

Then as conceptual recipe execution in the implementation of store 
procedures.

1- declare the file db.py the DAL object.
2- create layers / objects equiera your app, create a function that 
preferably standard form Therefore, allowing you to use the ".executesql" 
sentence and will complete missing only in the controller layer to call your 
new method parameters of the string SQL.
3- call your new function.
4- do not forget the bug tracking / exceptions
5- always test controllers individually, then proceeds to its implementation 
(using shell).
6- never stop trying and start with the basics and progressing to complex 
layered, 
solve it took me more than two weeks of trial and error and follow clues in 
the programs.

-- 
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] aws s3 uploadfs

2015-12-09 Thread Mark Graves
Hey everyone,

I've got an odd issue I've been experiencing.  

I uploaded about 10k files through the DAL into my local filesystem.

Then, I s3synced them, and mounted the s3 to the uploadfs for the DAL field.

The bucket and permissions for the keys and configuration works, because I 
accessed it via the command line and from the python interpreter manually. 
So I don't think its a configuration issue (but I could be wrong)

However using the field.retrieve() is not working.  It's giving me a 403 
error.

Any ideas on what I might look for in fixing this?

The error is coming in via both my custom code and appadmin, so I don't 
think its the code I wrote either.

-- 
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] db.define_table Advanced Field

2015-12-09 Thread Alessandro Leonetti
Good evening,

I'm running into a problem quite uncomfortable but I'm pretty sure there is 
a fairly simple way to resolve it.
I defined the various tables within my database and put them in relation 
with each other (one to many, many to many etc.).
The problem is that when I insert a new record in a table that requires me 
to a field in another table, I have to specify that field in the record ID 
which will be linked to the record that I am creating.

Example:

Tables: Worker & Leader
I want to specify, creating a new record in the table worker who is the 
head of the worker that I am entering:

Name: BOB
Surname: DYLAN
Leader: 3 --> HOW DO I APPEAR TO A MENU 'CURTAIN FROM 
WHICH CAN CHOOSE ONE OF THE LEADERS ALREADY' INCLUDED IN THE DATABASE 
INSTEAD OF DOVER INSERT EXACT LEADER ID ???

Dovrò specificare qualcosa all'interno di 
db.define_table('Worker',
Field('Name',requires=IS_NOT_EMPTY()),
Field('Surname',requires=IS_NOT_EMPTY()),
Field('LEADER', db.LEADER ..
   )
?

Thanks for any answers, it would be great if you could help me, I'm losing 
a lot of time!

Best Regard and sorry for my disappointing english,
Alessandro

-- 
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: aws s3 uploadfs

2015-12-09 Thread Mark Graves
Interesting update.

I used the same code from the command line, it worked.

Copied and pasted inside web2py, it stopped working with 403.  

On Wednesday, December 9, 2015 at 5:26:52 PM UTC-6, Mark Graves wrote:
>
> Hey everyone,
>
> I've got an odd issue I've been experiencing.  
>
> I uploaded about 10k files through the DAL into my local filesystem.
>
> Then, I s3synced them, and mounted the s3 to the uploadfs for the DAL 
> field.
>
> The bucket and permissions for the keys and configuration works, because I 
> accessed it via the command line and from the python interpreter manually. 
> So I don't think its a configuration issue (but I could be wrong)
>
> However using the field.retrieve() is not working.  It's giving me a 403 
> error.
>
> Any ideas on what I might look for in fixing this?
>
> The error is coming in via both my custom code and appadmin, so I don't 
> think its the code I wrote either.
>
>

-- 
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: How does auth.signature work? deletion of inactive records

2015-12-09 Thread Massimo Di Pierro
It is well hidden 

http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=auth.signature#Table-inheritance

On Wednesday, 9 December 2015 00:17:17 UTC-6, at wrote:
>
> Hi,
>
> I am unable to find explanation of how does auth.signature works anywhere 
> including web2py documentation. I can see that after adding it to a 
> database table definition, it starts maintaining a revision history of the 
> records. I've also seen that deletion of a record does not actually delete 
> it from the database but it is marked as inactive; what is the recommended 
> way or configuration that allows me delete the *inactive* records from 
> the database?
>
> Thanks,
> AT
>

-- 
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: How does auth.signature work? deletion of inactive records

2015-12-09 Thread 黄祥
i think you can use on delete database callback to execute sql syntax to 
delete the inactive record.

best regards,
stifan

-- 
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: Retrieve record field labels in sqlform.grid custom view

2015-12-09 Thread Massimo Di Pierro
yes

db.memos.code.label = 'Codice'
grid = SQLFORM.grid(db.memos)

Notice that:

if grid.view_form is not None than it is the readonly form. It therefore 
contains grid.view_form.record.code but this is the field value not the 
field object and therefore it is a 'string' and it does not have a label 
attribute. grid.view_form.table.code is the Field object and it does have 
the label attributes but it is useless because the grid.view_form at this 
point has already been built.


On Sunday, 29 November 2015 11:52:30 UTC-6, Gael Princivalle wrote:
>
> Hello everybody.
>
> Is there a way in a sqlform.grid to retrieve record field labels in a 
> custom view?
> Something like that:
> grid.view_form.record.code.label
>
> To retrieve:
> db.define_table('memos',
> Field('code', type='string', requires=IS_NOT_EMPTY(), label='*Codice*'
> ),
>
> Thanks, 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: aws s3 uploadfs

2015-12-09 Thread Massimo Di Pierro
Let's look at this in my office tomorrow. ;-)

On Wednesday, 9 December 2015 18:58:12 UTC-6, Mark Graves wrote:
>
> Interesting update.
>
> I used the same code from the command line, it worked.
>
> Copied and pasted inside web2py, it stopped working with 403.  
>
> On Wednesday, December 9, 2015 at 5:26:52 PM UTC-6, Mark Graves wrote:
>>
>> Hey everyone,
>>
>> I've got an odd issue I've been experiencing.  
>>
>> I uploaded about 10k files through the DAL into my local filesystem.
>>
>> Then, I s3synced them, and mounted the s3 to the uploadfs for the DAL 
>> field.
>>
>> The bucket and permissions for the keys and configuration works, because 
>> I accessed it via the command line and from the python interpreter 
>> manually. So I don't think its a configuration issue (but I could be wrong)
>>
>> However using the field.retrieve() is not working.  It's giving me a 403 
>> error.
>>
>> Any ideas on what I might look for in fixing this?
>>
>> The error is coming in via both my custom code and appadmin, so I don't 
>> think its the code I wrote either.
>>
>>

-- 
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: How does auth.signature work? deletion of inactive records

2015-12-09 Thread at
Thank you Massimo.

One quick question: When we use auth.signature, and then delete records in 
a table, they are marked as deleted but they are not actually deleted from 
the database. What is the recommended way to delete such records from the 
database?

Best Regards,
AT

On Thursday, 10 December 2015 09:35:15 UTC+5, Massimo Di Pierro wrote:
>
> It is well hidden 
> n
>
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=auth.signature#Table-inheritance
>
> On Wednesday, 9 December 2015 00:17:17 UTC-6, at wrote:
>>
>> Hi,
>>
>> I am unable to find explanation of how does auth.signature works anywhere 
>> including web2py documentation. I can see that after adding it to a 
>> database table definition, it starts maintaining a revision history of the 
>> records. I've also seen that deletion of a record does not actually delete 
>> it from the database but it is marked as inactive; what is the recommended 
>> way or configuration that allows me delete the *inactive* records from 
>> the database?
>>
>> Thanks,
>> AT
>>
>

-- 
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: Pyodel announcement

2015-12-09 Thread Massimo Di Pierro
This was built by some of my students. It is incomplete but has lots of 
goodies.

On Wednesday, 9 December 2015 14:53:33 UTC-6, Richard D wrote:
>
> Hi,
>
> Some years ago a discussion took place about a LMS. Since then Alan Etkin 
> has created Pyodel.
> I contacted Alan and decided to take this project forward.
>
> A Github repo https://github.com/RichDijk/pyodel is created for code 
> management.
>
> This is the initial version which is exact like the last version from the 
> Google code repo.
>
> A Google group has been created for collaboration 
> https://groups.google.com/forum/#!forum/pyodel
>
> My idea is to create designs and builds of small parts. Because of this 
> Pyodel will not be fully functional for quite a while, parts will be 
> perfect.
> A major challange is the content format. Will we use SCORM, rest of a new 
> JSON based format?
>
> Hope to see you on Pyodel.
>
> Richard Dijkstra
>

-- 
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 - on ubuntu 12.04 vps.net

2015-12-09 Thread Massimo Di Pierro
Just be clear. Apache is a very old product and we do not recommend it with 
web2py. We recommend nginx.

On Wednesday, 9 December 2015 14:31:07 UTC-6, Pierre-Antoine Roiron wrote:
>
> Cam you check that default.conf is in /etc/apache2/site-enable/, and that 
> it contains references to web2py?

-- 
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] SQLFORM.grid custom buttons text

2015-12-09 Thread Анатолий Стешенко
Good day. How i can change text of buttons of the SQLFORM.grid?
For example i want to change "Add Record" to "Add new item","View" to "Show 
details".

-- 
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: Using apsw with web2py

2015-12-09 Thread Massimo Di Pierro
The easiest way is this:

download the windows version of web2py. Unzip it. Put all the modules you 
need in web2py/site-packages. Install your app (bytecode compiled) and call 
it "init".  Then zip the web2py folder again. That is your distributable 
binary app.


On Wednesday, 9 December 2015 09:03:27 UTC-6, Jitun John wrote:
>
> Thanks a lot Massimo Di Pierro, Its working great.
> I wanted to make an .exe of the application, so I added to 
> web2py/applications/yourapp/modules/
> I kind of figured out how to use DAL with similar functionality. 
> So I will play with both settings.
>
>
> On Tuesday, December 8, 2015 at 10:43:43 AM UTC+5:30, Massimo Di Pierro 
> wrote:
>>
>> You can definitively do that. You can use any module that works with 
>> python with web2py. You just have to make some choices about whether you 
>> want to distribute your module with your app or not.
>>
>> If you do not want to distribute it with your app:
>> - If you run web2py from source you can put it into the normal python 
>> site-packages
>> - if you run web2py binary, you have to put your module in 
>> web2py/site-packages
>>
>> If you do want to distribute it with your app, then it is a web2py 
>> specific logic.
>> - you have to put it into web2py/applications/yourapp/modules/ and you 
>> still import with "import modulename".
>> Not all modules can be distributed distributed in 
>> web2py/applications/yourapp/modules/. Only modules that do not assume they 
>> are in site-packages and use relative import.
>>
>> Massimo
>>
>>
>>
>> On Monday, 7 December 2015 17:03:36 UTC-6, Jitun John wrote:
>>>
>>>
>>> Hi I am an amateur programmer and new to web2py.
>>>
>>> I have written python scripts with apsw imported. (
>>> http://rogerbinns.github.io/apsw/)
>>> It allows me to create a db in the memory and once all 
>>> processing/insertion is done, one can backup the date to an .sqlite file on 
>>> the disk.
>>> This .sqlite file can be read and loaded into the memory at some later 
>>> point in time as well.
>>> I was wondering if I can import apsw into web2py module .py (apsw works 
>>> with python 2.x)
>>> At present I get "Cannot import module applications.admin.modules.apsw"
>>>
>>> mem_db_connection = apsw.Connection(":memory:")
>>> cursor = mem_db_connection.cursor()
>>>
>>> # Copy from memory to file
>>> with global_db_backup_con.backup("main", mem_db_connection, "main") 
>>> as backup:
>>> backup.step()   # copy whole database in one go
>>>
>>> If not, then is there anything similar I can use in web2py ?
>>> I plan to make a simple log analysis app which runs on locally on 
>>> clients unit.
>>>
>>

-- 
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: SQLFORM.grid custom buttons text

2015-12-09 Thread Massimo Di Pierro
One way is to use internationalization. Make an en.py language file and 
translate the strings anyway one want, using the admin languages tab. No 
coding required.


On Wednesday, 9 December 2015 22:57:39 UTC-6, Анатолий Стешенко wrote:
>
> Good day. How i can change text of buttons of the SQLFORM.grid?
> For example i want to change "Add Record" to "Add new item","View" to 
> "Show details".
>

-- 
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: Static files inside of folder with spaces (url encoding)

2015-12-09 Thread Anthony
If you don't need to use the pattern-based rewrite system, you can use the 
parameter-based rewrite system to customize the legal characters allowed in 
static file names. Just create a routes.py file in the root /web2py folder 
and include the following:

routers = dict(
BASE=dict(
file_match = r'([ -+=@$%\w]|(?<=[ -+=@$%\w])[./])*$'
)
)

Note, the default value of file_match is:

r'([-+=@$%\w]|(?<=[-+=@$%\w])[./])*$'

My code simply adds spaces to the regex.

Anthony

On Wednesday, December 9, 2015 at 9:08:19 AM UTC-5, Jaime Sempere wrote:
>
> Yes, that's my problem the web2py server looks like he is not able to 
> handle spaces on static paths to access those files... any other advice?
>
>
> El miércoles, 9 de diciembre de 2015, 14:31:36 (UTC+1), Anthony escribió:
>>
>> Are you serving web2py via the built-in server? If not, you can configure 
>> your web server (e.g., nginx or Apache) to server static files directly.
>>
>> Anthony
>>
>>>
>>>

-- 
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 - on ubuntu 12.04 vps.net

2015-12-09 Thread dirman
i used the script: 

wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
and
chod +x setup-web2py-ubuntu.sh
./setup-web2py-ubuntu





On Wednesday, December 9, 2015 at 4:35:19 PM UTC, Anthony wrote:
>
> Did you follow the deployment instructions for Apache: 
> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Apache-setup
>
> On Wednesday, December 9, 2015 at 11:09:09 AM UTC-5, dirman wrote:
>>
>> i just install web2py on ubuntu 12.04 on vps.net server but can't route 
>> to web2py
>>
>> this is what i am getting from Apache instead of the web2py welcome app
>>
>> It works! 
>>
>> This is the default web page for this server.
>>
>> The web server software is running but no content has been added, yet.
>>
>>
>>  i need 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.