[web2py] Re: web2py 2.14.4 is OUT

2016-04-25 Thread Ben Lawrence
Does the shell still work or is it just me who cannot work it?
Whenever I place anything in the .../admin/shell/index/welcome, it just 
prints "None"


On Tuesday, April 12, 2016 at 2:29:26 PM UTC-7, Massimo Di Pierro wrote:
>
> web2py 2.14.4 is out.
>
> It fixes some a problem with CAS and some style issues with examples.
> It also includes (and passes) a lot of new tests. 
>
> Thanks to Richard Vezina, Simone and Leonel for doing most of the work in 
> this release.
>
> Massimo
>

-- 
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: web2py slices down

2016-04-25 Thread Ovidio Marinho
again this is terrible





   [image: http://itjp.net.br] 
 http://itjp.net.b r
  *Ovidio Marinho Falcao Neto*
 ovidio...@gmail.com
Brasil


2016-04-25 22:40 GMT-03:00 Massimo Di Pierro :

> will contact the maintainers and will move it.
>
>
> On Sunday, 24 April 2016 18:30:55 UTC-5, Henk huisman wrote:
>>
>> Yes already 3 days down.
>> Anybody home?
>>
>>
>> Op zondag 24 april 2016 11:29:57 UTC-4 schreef luis.va...@metamaxzone.com
>> :
>>>
>>> Web2py slices (http://www.web2pyslices.com/home) is down, shows a
>>> ticket when try to access
>>>
>>> Internal errorTicket issued: unknown
>>> 
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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: Ajax Form Update (and thank you for all the help)

2016-04-25 Thread Massimo Di Pierro
Can you show up some more code.

On Monday, 25 April 2016 08:51:14 UTC-5, Mark Billion wrote:
>
> I have a form that is accessed through ajax and displayed in a 
> modalRight now, on success, the modal clears and the parent page is 
> reloaded, which then shows the data that was entered in the table.
>
> i.e., 
>
> ajax_form = SQLFORM(...).process(next = URL('default', page_name))
>
> {{for x in y:}}
> 
> x.idx.attr1x.attr2
> 
> {{pass}}
>
>
> I want to prevent the parent from reloading and update the parent page via 
> ajax on form success to include the data that is entered.  Can anyone point 
> me to a script I can modify?
>

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

2016-04-25 Thread Massimo Di Pierro
will contact the maintainers and will move it.

On Sunday, 24 April 2016 18:30:55 UTC-5, Henk huisman wrote:
>
> Yes already 3 days down.
> Anybody home?
>
>
> Op zondag 24 april 2016 11:29:57 UTC-4 schreef luis.va...@metamaxzone.com:
>>
>> Web2py slices (http://www.web2pyslices.com/home) is down, shows a ticket 
>> when try to access
>>
>> Internal errorTicket issued: unknown 
>> 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Multiple selection dropdown widget, UI

2016-04-25 Thread Carlos Zenteno
Thank for asking and answering yourself.  I am sure somebody will find it 
useful.

-- 
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: Multiple selection dropdown widget, UI

2016-04-25 Thread Carlos Zenteno
Thank for asking and answering yourself.  I am sure somebody will find it 
useful.

-- 
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] new Starter app (alternative to Welcome app)

2016-04-25 Thread Michael Beller
Yes - thanks.  I knew about that bug, just fixed it.  The background and
font were both white.  Can you check now?

On Mon, Apr 25, 2016 at 6:07 PM, Ron Chatterjee 
wrote:

> Have you tested this starter app on mobile. When I hover over "log in"
> from a 9 inch tablet or small phone, I see a blank white screen for log in
> till I start scrolling, I see the other menu one by one.
>
>
>
> On Friday, March 25, 2016 at 12:39:53 PM UTC-4, Alessio Varalta wrote:
>>
>> Is great! I think is a good choose to introduce a functionality that in
>> admin console you can choose this as starter
>>
>> On Friday, 25 March 2016 11:09:38 UTC+1, Ramos wrote:
>>>
>>> This starter is sooo cool.
>>> Its was time we had something like this.
>>>
>>>
>>>
>>> 2016-03-24 19:51 GMT+00:00 Ron Chatterjee :
>>>
 Its all good. Just asked.


 On Thursday, March 24, 2016 at 3:33:00 PM UTC-4, Michael Beller wrote:
>
> No Avatar field yet!  It's hardcoded in the template.  It should be
> easy to add a custom field to the auth_user table following these
> instructions:
>
> http://web2py.com/books/default/chapter/29/09/access-control?search=auth_user#Customizing-Auth
>
> Then you can upload an avatar using the user profile page.
>
> I haven't done this with images but it should be straight forward
> (it's on my todo list!)
>
> You can also designate a dedicated folder for the avatar uploads so
> they're not commingled with other upload files ...
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=upload#SQLFORM-and-uploads
>
> On Thursday, March 24, 2016 at 3:03:41 PM UTC-4, Ron Chatterjee wrote:
>>
>> I am sorry, I was having some problem downloading the latest version
>> so everything is good. Quick question Michael, how does someone change 
>> the
>> profile picture? There is a avatar field?
>>
>> On Thursday, March 24, 2016 at 11:56:27 AM UTC-4, Michael Beller
>> wrote:
>>>
>>> The appconfig in 2.13 has a problem with strings separated by
>>> comma's in the appconfig.ini file.  Starter app uses 2.14.1
>>>
>>> You can either install 2.14.1 or just change ...
>>>
>>> line 34 in initialize.py:
>>> for group in myconf.get('admin_user.auth_groups'):
>>>
>>> could replace with
>>> for group in ['Admin', 'Customer Service', 'Operations']:
>>>
>>> or just change the function to create the Admin group which is all
>>> that's needed.
>>>
>>>
>>>
>>> On Thu, Mar 24, 2016 at 11:20 AM, Ron Chatterjee <
>>> achatte...@gmail.com> wrote:
>>>
 Not sure its ready to be posted. I just downloaded the app and I
 don't see any initialization. My experience...it seems have some issues
 still (see the attached pic) . When I tried to register, I get this 
 error:


 Traceback *(*most recent call last
 *):   *File "…\web2py\gluon\restricted.py"*, *line 227*, in *
 restricted
 *exec *ccode *in *environment
   File" …applications/starter/controllers/default.py"
 *,
 *line 91*, in <*module
 *>   *File "…web2py\gluon\globals.py"*, *line 412
 *, in  self.*_caller *= lambda *f*: *f
 *()   *File …/starter/controllers/default.py"
 *,
 *line 70*, in *user
 *return *dict*(*form*=*auth
 *())   *File "…web2py\gluon\tools.py"*, *line 1923*, in *__call__
 *return *getattr*(self, *args*[*0
 *])()   *File "…\tools.py"*, *line 3375*, in *register
 *self.*login_user*(*user
 *)   *File "…web2py\gluon\tools.py"*, *line 2630*, in *login_user
 user *= *Row*(*user
 *)   *File "…\helpers\classes.py"*, *line 18*, in *__init__
 *return self.*__dict__*.*__init__*(**args*, ***kwargs
 *) *TypeError*: *'NoneType' object *is not *iterable

 Using 2.13.4 (which has a flash bar rash that just don't go away).



 On Thursday, March 24, 2016 at 10:38:35 AM UTC-4, Michael Beller
 wrote:
>
> I commonly create a user (usually my email) and an Admin group and
> then add myself to the Admin group.  I have logic in the Starter app 
> based
> on the Admin group.  I usually have other groups such as Operations 
> and
> Customer Service (I tend to build enterprise 'line of business' apps).
> Since I frequently clean out the database during initial development, 
> I
> just created an initialization function that automatically adds an 
> initial
> set of test users, groups, and 

[web2py] db bulk_insert issue

2016-04-25 Thread 'Laer Cius' via web2py-users
Hi,

I try to insert some demo data in my db using this :

for fav_record in range(1, 1): object_type = choice(range(1, 5))

if object_type == 1: object_id = choice(range(1, 504))
elif object_type == 2: object_id = choice(range(1, 7))
elif object_type == 3: object_id = choice(range(1, 17))
elif object_type == 4: object_id = choice(range(1, 61))

demo_data.append({
'object_id': object_id,
'object_type': object_type,
'user_id': choice(range(1, 504))
})

db.m_favourite.bulk_insert(demo_data)
db.commit()

a code which returns what I want in the python shell (db aside)  but when 
loading in db (postgresql) throught the application (the code is in a 
module loading if db is empty) I get the following as result :

id, object_id, object_type, user_id
"35960";13;2;1
"33820";40;4;1
"37416";6;3;1
"38077";4;4;1
"30097";39;4;1
"36511";43;3;1
"34819";45;2;1
"35723";35;1;1
"39200";19;4;1
"30869";1;3;1
"33347";47;1;1
"37439";43;3;1
"30403";3;3;1
"30133";55;2;1
"38242";8;3;1
"34273";46;4;1
"34218";49;2;1
"36811";47;1;1
"31154";39;4;1
"37125";40;2;1
"33974";45;1;1
"32078";1;3;1
"36548";53;3;1
"34855";33;1;1
"38634";32;4;1
"36846";45;1;1
"33554";44;3;1
"36122";27;1;1

Where you can notice some object_type set at 2 having an object_id set to 
something > 6 ?

I really don't understand why.

Thank you

-- 
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: Component within component

2016-04-25 Thread webmaster
Note:  This may also have something to do with fancybox, which is what I 
use for the modal.

On Monday, April 25, 2016 at 3:35:09 PM UTC-7, webm...@trytha.com wrote:
>
> I have the following general setup:
>
> Main Page - basically just a container that holds the...
>
> ...Infinite Pagination Pictures Component - loads 10 pictures and my 
> comment() component (one for each picture), which when clicked, opens the...
>
> ...Picture Modal - a component that loads in a modal on top of the other 
> component to display the picture you clicked on.
>
>
> I use LOAD() for all of these.  Here's my problem:  If I try to load my 
> comment() component in the modal as well, all the comment() components in 
> the Infinite Pagination Pictures Component reload as well.  I have separate 
> namespaces based on whether comment() is in a modal or not, but this seems 
> linked to my need to put "{{include 'web2py_ajax.html'}}" in the view of 
> any component that has components within it.  
>
> Is it just not supported to have a sub-component load a component that is 
> also present in the parent-component?  I actually created an infinite loop 
> doing something similar not long ago.
>
> As a workaround, I've been loading the component with JS calling AJAX, 
> which works fine:
>
> //- Load the comments component.
> span(id="load-comments" 
> data-url="{{=URL('social', 'comments', 'comments.load', 
> vars=dict(pic_id=pic_id, comment_open='True'))}}" 
> data-target="pics-comment-container")
> //- AJAX container to load comments.
> div(id="pics-comment-container")
> //- AJAX call to load comments in the appropriate container.
> script.
> $(document).ready(function (e) {
> elem = $('#load-comments'); // elem = $(e.target)
> url = elem.attr("data-url");
> target = elem.attr("data-target");
> web2py_ajax_page("GET", url, "", target);
> return false; // e.preventDefault()
> });
>
>
>

-- 
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] Component within component

2016-04-25 Thread webmaster
I have the following general setup:

Main Page - basically just a container that holds the...

...Infinite Pagination Pictures Component - loads 10 pictures and my 
comment() component (one for each picture), which when clicked, opens the...

...Picture Modal - a component that loads in a modal on top of the other 
component to display the picture you clicked on.


I use LOAD() for all of these.  Here's my problem:  If I try to load my 
comment() component in the modal as well, all the comment() components in 
the Infinite Pagination Pictures Component reload as well.  I have separate 
namespaces based on whether comment() is in a modal or not, but this seems 
linked to my need to put "{{include 'web2py_ajax.html'}}" in the view of 
any component that has components within it.  

Is it just not supported to have a sub-component load a component that is 
also present in the parent-component?  I actually created an infinite loop 
doing something similar not long ago.

As a workaround, I've been loading the component with JS calling AJAX, 
which works fine:

//- Load the comments component.
span(id="load-comments" 
data-url="{{=URL('social', 'comments', 'comments.load', 
vars=dict(pic_id=pic_id, comment_open='True'))}}" 
data-target="pics-comment-container")
//- AJAX container to load comments.
div(id="pics-comment-container")
//- AJAX call to load comments in the appropriate container.
script.
$(document).ready(function (e) {
elem = $('#load-comments'); // elem = $(e.target)
url = elem.attr("data-url");
target = elem.attr("data-target");
web2py_ajax_page("GET", url, "", target);
return false; // e.preventDefault()
});


-- 
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] new Starter app (alternative to Welcome app)

2016-04-25 Thread Ron Chatterjee
Have you tested this starter app on mobile. When I hover over "log in" from 
a 9 inch tablet or small phone, I see a blank white screen for log in till 
I start scrolling, I see the other menu one by one. 

 

On Friday, March 25, 2016 at 12:39:53 PM UTC-4, Alessio Varalta wrote:
>
> Is great! I think is a good choose to introduce a functionality that in 
> admin console you can choose this as starter
>
> On Friday, 25 March 2016 11:09:38 UTC+1, Ramos wrote:
>>
>> This starter is sooo cool.
>> Its was time we had something like this.
>>
>>
>>
>> 2016-03-24 19:51 GMT+00:00 Ron Chatterjee :
>>
>>> Its all good. Just asked. 
>>>
>>>
>>> On Thursday, March 24, 2016 at 3:33:00 PM UTC-4, Michael Beller wrote:

 No Avatar field yet!  It's hardcoded in the template.  It should be 
 easy to add a custom field to the auth_user table following these 
 instructions:

 http://web2py.com/books/default/chapter/29/09/access-control?search=auth_user#Customizing-Auth

 Then you can upload an avatar using the user profile page.

 I haven't done this with images but it should be straight forward (it's 
 on my todo list!)

 You can also designate a dedicated folder for the avatar uploads so 
 they're not commingled with other upload files ...

 http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=upload#SQLFORM-and-uploads

 On Thursday, March 24, 2016 at 3:03:41 PM UTC-4, Ron Chatterjee wrote:
>
> I am sorry, I was having some problem downloading the latest version 
> so everything is good. Quick question Michael, how does someone change 
> the 
> profile picture? There is a avatar field?
>
> On Thursday, March 24, 2016 at 11:56:27 AM UTC-4, Michael Beller wrote:
>>
>> The appconfig in 2.13 has a problem with strings separated by comma's 
>> in the appconfig.ini file.  Starter app uses 2.14.1
>>
>> You can either install 2.14.1 or just change ...
>>
>> line 34 in initialize.py:
>> for group in myconf.get('admin_user.auth_groups'):
>>
>> could replace with
>> for group in ['Admin', 'Customer Service', 'Operations']:
>>
>> or just change the function to create the Admin group which is all 
>> that's needed.
>>
>>
>>
>> On Thu, Mar 24, 2016 at 11:20 AM, Ron Chatterjee <
>> achatte...@gmail.com> wrote:
>>
>>> Not sure its ready to be posted. I just downloaded the app and I 
>>> don't see any initialization. My experience...it seems have some issues 
>>> still (see the attached pic) . When I tried to register, I get this 
>>> error:
>>>
>>>
>>> Traceback *(*most recent call last
>>> *):   *File "…\web2py\gluon\restricted.py"*, *line 227*, in *
>>> restricted
>>> *exec *ccode *in *environment
>>>   File" …applications/starter/controllers/default.py" 
>>> *,
>>>  
>>> *line 91*, in <*module
>>> *>   *File "…web2py\gluon\globals.py"*, *line 412
>>> *, in  self.*_caller *= lambda *f*: *f
>>> *()   *File …/starter/controllers/default.py" 
>>> *,
>>>  
>>> *line 70*, in *user
>>> *return *dict*(*form*=*auth
>>> *())   *File "…web2py\gluon\tools.py"*, *line 1923*, in *__call__
>>> *return *getattr*(self, *args*[*0
>>> *])()   *File "…\tools.py"*, *line 3375*, in *register
>>> *self.*login_user*(*user
>>> *)   *File "…web2py\gluon\tools.py"*, *line 2630*, in *login_user
>>> user *= *Row*(*user
>>> *)   *File "…\helpers\classes.py"*, *line 18*, in *__init__
>>> *return self.*__dict__*.*__init__*(**args*, ***kwargs
>>> *) *TypeError*: *'NoneType' object *is not *iterable
>>>
>>> Using 2.13.4 (which has a flash bar rash that just don't go away). 
>>>
>>>
>>>
>>> On Thursday, March 24, 2016 at 10:38:35 AM UTC-4, Michael Beller 
>>> wrote:

 I commonly create a user (usually my email) and an Admin group and 
 then add myself to the Admin group.  I have logic in the Starter app 
 based 
 on the Admin group.  I usually have other groups such as Operations 
 and 
 Customer Service (I tend to build enterprise 'line of business' apps). 
  
 Since I frequently clean out the database during initial development, 
 I 
 just created an initialization function that automatically adds an 
 initial 
 set of test users, groups, and memberships so I don't have to do it 
 manually,   The Initialization function also calls a function that 
 automatically populates tables with test data (using the Populate 
 function) 
 that is helpful for quick demos during prototyping and 

[web2py] Re: running app from command line with no server startup window

2016-04-25 Thread Jacob Thoennes
Yes, I packed it with the new version, same as the one I installed it in. 

-- 
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: caching questions

2016-04-25 Thread Anthony
On Monday, April 25, 2016 at 2:37:01 PM UTC-4, Pierre wrote:
>
> suppose I would allow every user to cache some of its individualized 
> selects. wouldn't that be too expensive in terms of consumed 
> cache.disk/cache.ram ?
>

Perhaps. Caching highly individualized selects also won't have much 
benefit, as you are not likely to need to serve the cached data many times. 
Note, you can also periodically clear cached items.

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: running app from command line with no server startup window

2016-04-25 Thread Niphlod
you should pack the app in the same version it'll be executed ... did you 
copy the source and then packed on 2.14.5 and then executed on 2.14.5 or 
you kept the packed version of 2.13.x ?

On Friday, April 22, 2016 at 9:29:05 PM UTC+2, Jacob Thoennes wrote:
>
> I was initially on 2.13, I just updated to 2.14.5 and still have the same 
> problem. Also after the update when I run the packed app from web2py.exe it 
> is messing up and showing the default dictionary view instead of the view I 
> specified, which didn't happen before (all I did was drag the application 
> folder to the new web2py).
>
> edit: I should clarify, what I did was drag the application folder to a 
> up-to-date web2py install and then I went through the deployment steps with 
> yet another new install while packing the app in the up-to-date 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] Re: Multi language database query

2016-04-25 Thread Niphlod
that query is largely inefficient though. use response.toolbar() to see how 
many queries that statement generates.

I really don't get how the data is stored into the model. example records 
of each table and of the resultset would be beneficial to craft the needed 
query

On Friday, April 22, 2016 at 9:36:56 PM UTC+2, Marko Seppälä wrote:
>
> I think that that reference in language_tr table is needed. Otherwise 
> there is no way to translate those for more than one language I think.
>
> For example, if we have two languages, let's say English and German, and 
> we want to translate both languages to both languages. So for example 
> language with code "en" would be translated to "English" with 
> translation.language_id.code == "en" and to "Englisch" 
> with translation.language_id.code == "de". But language_tr would be 
> referencing to language_id.code == "en" in both cases.
>
> Otherwise your answer is very good! I'm still very beginner with this so 
> step by step instructions are very welcome :)
>
> I was able to make it work this way:
> languages = db((db.language_tr.id>0)).select()
> for language in languages.exclude(lambda language: 
> language.translation_id.language_id!=system_language_id):
> pass
>
> This looks somewhat ugly, I'm sure that there is a better way.
>
> perjantai 22. huhtikuuta 2016 22.02.40 UTC+3 Niphlod kirjoitti:
>>
>> imho there's a reference not needed (the language_id in the language_tr 
>> table)
>>
>> that being said...let's build queries, step by step
>>
>> """
>> Basically I'm looking for a list of language_tr elements which has a 
>> translation_id which has a language_id which is same than users selected 
>> system language.
>> """
>> start backwards:
>> . let's name tables with a shorter name (we don't want to die in the 
>> process of typing)
>> lng = db.language
>> trs = db.translation
>> ltr = db.language_tr
>> . what's the Query we need to filter out of the language the user selects 
>> ? 
>> lng.code == 'user_selected_language'
>> . what's the translation row(s) related to that record ?
>> .. we need to join by the link between lng and trs
>>(lng.id == trs.language_id)
>> . what are language_tr row(s) related to the trs record ?
>> .. we need to join by the link between trs and ltr 
>>(trs.id == ltr.translation_id)
>> . summing up all relations, we now have
>>(lng.id == trs.language_id) & (trs.id == ltr.translation_id) 
>> . we append our Query
>>(lng.id == trs.language_id) & (trs.id == ltr.translation_id) & 
>> (lng.code == 'user_selected_language')
>> . what do we want ? ltr.ALL, let's select it
>> . cook it up alltogether
>> db(
>>  (lng.id == trs.language_id) & (trs.id == ltr.translation_id) & 
>> (lng.code == 'user_selected_language')
>>  ).select(ltr.ALL)
>>
>> On Friday, April 22, 2016 at 3:51:51 PM UTC+2, Marko Seppälä wrote:
>>>
>>> Hi,
>>>
>>> I have a following database:
>>>
>>> db.define_table('language',
>>> Field('code', 'string', unique=True)
>>> )
>>>
>>> db.define_table('translation',
>>> Field('language_id', 'reference language', notnull=True, 
>>> readable=True, writable=True),
>>> auth.signature
>>> )
>>>
>>> db.define_table('language_tr',
>>> Field('translation_id', 'reference translation', notnull=True, 
>>> readable=True, writable=True),
>>> Field('language_id', 'reference language', notnull=True, 
>>> readable=True, writable=True),
>>> Field('name', notnull=True)
>>> )
>>>
>>> So basically I have a list of supported languages in the language table. 
>>> Then language_tr table has all names for those languages, in every 
>>> possible language. language_id references to the language which is 
>>> translated and translation_id references to the translation, which has 
>>> language_id 
>>> for the language which is used for the translation.
>>>
>>> In database this works great, but I'm having problems to build a simple 
>>> enough database query to get all translations whit selected language only. 
>>> For example, user wants to use English and sets that to system language. So 
>>> I want to show translations only in English, not with all possible 
>>> languages.
>>>
>>> What is the most efficient way to get only translations in English? 
>>> Basically I'm looking for a list of language_tr elements which has a 
>>> translation_id 
>>> which has a language_id which is same than users selected system 
>>> language.
>>>
>>> - Marko
>>>
>>>

-- 
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: caching questions

2016-04-25 Thread Pierre
suppose I would allow every user to cache some of its individualized 
selects. wouldn't that be too expensive in terms of consumed 
cache.disk/cache.ram ?
Perhaps caching is more suitable for shared data ?

-- 
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 to add payment integration in web2py?

2016-04-25 Thread Dave S


On Monday, April 25, 2016 at 7:57:43 AM UTC-7, pbreit wrote:
>
> I'd say go review the documentation of Stripe or PayMill. You put some 
> JavaScript on your payment page. The form submits a "token" to your server 
> which you POST to Stripe/Paymill to process the payment. It's all pretty 
> easy.
>

There's also discussion of it in the book:

 Stripe is one of the examples in that section.

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


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

2016-04-25 Thread Richard Vézina
I think it comes from here :

https://github.com/web2py/pydal/blob/85c530cc791e2aadbbbf6302b2f58d354d9800b5/pydal/helpers/rest.py#L70

As RestParse is used here :

https://github.com/web2py/pydal/blob/85c530cc791e2aadbbbf6302b2f58d354d9800b5/pydal/base.py#L538

By parse_as_rest()

RestParse don't seems to support unicode URL yet...

You may consider open an issue here :

https://github.com/web2py/pydal/issues/new

If someone (Massimo or Giovanni) can confirmed this...

Thanks

Richard

On Sun, Apr 24, 2016 at 11:28 AM, Mamisoa Andriantafika 
wrote:

> The goal is to receive the right result from the query in the GET request.
>
> As you saw, in the first query I get the result of the user that where
> first name, name and dob correspond to the parameters.
>
> But when I had the accented character, I cannot get the expected same
> result.
>
> From the first response, one can see that the query may have been done in
> UTF8. So I think that I should feed the GET request with a kind of UTF8
> encoded characters, although I'm already in UTF8?
>
> Le dimanche 24 avril 2016 14:57:23 UTC+2, Richard a écrit :
>>
>> I don't understrand... Are you trying to generate this URL or you receive
>> the request? Does it fails for a request you receive?
>>
>> On Sat, Apr 23, 2016 at 8:38 PM, Mamisoa Andriantafika 
>> wrote:
>>
>>> Just to be clearer, here is a response from the following get:
>>>
>>>
>>> https://localhost/test/default/api_users/user/ma/li/1978-01-01
>>>
>>>
>>>
>>>
>>> {"content": [{"birth_country_pid23": "France", "first_name":
>>> "Ma\u00eft", "last_name": "Li\u00e9", "modified_by": null,
>>> "id": 42, "gender_pid8": 2, "created_by": null, "birth_town_pid23":
>>> "Paris", "ssn_pid19": "", "created_on": "2016-04-23 15:59:49",
>>> "modified_on": "2016-04-23 15:59:49", "maiden_name_pid6":
>>> "Li\u00e9", "idc_num": "", "dob_pid7": "1978-01-01"}]}
>>>
>>>
>>> but if I add the search with the accent:
>>>
>>>
>>> https://localhost/test/default/api_users/user/maï/lié/1978-01-01
>>>
>>>
>>>
>>>
>>> {"content": []}
>>>
>>>
>>>
>>>
>>> ??
>>>
>>> Le samedi 23 avril 2016 22:48:29 UTC+2, Mamisoa Andriantafika a écrit :

 Hi,

 Using this usual REST code in controller :

 def api_users():
 response.view = 'generic.json' # or 'generic.' + request.extension
 def GET(*args,**vars):
 patterns = [
 "/user[auth_user]",
 "/user/{auth_user.id}",
 "/user/{auth_user.id}/:field",

 "/user/{auth_user.first_name.contains}/{auth_user.last_name.contains}/{auth_user.dob_pid7.eq}"
 ]
 db.auth_user.created_by.readable = 
 db.auth_user.modified_by.readable
 = db.auth_user.created_on.readable = db.auth_user.modified_on.readable
 = True
 parser = db.parse_as_rest(patterns, args, vars)
 data = parser.response
 if parser.status == 200:
 return dict(content=data)
 else:
 raise HTTP(parser.status, parser.error)

 with the last pattern, if I use character with accent e.g:

 /user/maït/lié

 the query do not find match as it is not interpreted as:

 "ma\u00eft" for first vars and
 "li\u00e9" for the second vars

 which is the encoding I find when I do the request /user/ma/li .

 How can I correct the encoding transcription so that the request comply
 to the format:

 /user/maï/lié

 ?

 Mike



 --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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

[web2py] Re: Multiple selection dropdown widget, UI

2016-04-25 Thread Ron Chatterjee
I guess this is all I had to do.



http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";>
http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css;
rel="stylesheet" type="text/css" />
http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js";>
http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/css/bootstrap-multiselect.css;
rel="stylesheet" type="text/css" />
http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js";
type="text/javascript">

$(function () {
$('#Project_duration').multiselect({
includeSelectAllOption: true
});
});


It works! 

On Monday, April 25, 2016 at 10:11:26 AM UTC-4, Ron Chatterjee wrote:
>
> I guess, I can do something similar to this:
>
> https://groups.google.com/forum/#!topic/web2py/miYi2aHXo6A
>
> But doesn't do multiple selection.
>
>
>
> On Sunday, April 24, 2016 at 5:16:36 PM UTC-4, Ron Chatterjee wrote:
>>
>>  duration_str = ('Month or less', '6 months', '1 year')
>>
>> Field('duration', type='list:string',requires=IS_IN_SET((duration_str), 
>> multiple=True),widget=lambda field, value: 
>> SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
>> label=True)),
>>
>> This create a multiple selection but the UI is very generic. Wondering if 
>> any widget will give me an UI similar to the link below (explained in pic) 
>> with tags?
>>
>> http://semantic-ui.com/modules/dropdown.html
>>
>> See section
>> "Multiple Selection 
>>
>> A selection dropdown can allow multiple selections
>>
>> "
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: caching questions

2016-04-25 Thread Anthony
On Monday, April 25, 2016 at 10:09:38 AM UTC-4, Pierre wrote:
>
>
> what I was wondering is the type of data of a dynamic app demanding 
> caching ?
> what typically needs caching in such a context ?
>

It depends on the nature of the data. It can be beneficial to cache any 
data that changes significantly less frequently than the typical interval 
between requests for those data. You might also want to cache things that 
are expensive to compute/retrieve, even if the cached version will often be 
a little stale. For example, if you are displaying a Twitter feed, you 
might want to cache the feed for 15-30 minutes so you don't have to do a 
slow HTTP request to a third-party API on every request.

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: How to add payment integration in web2py?

2016-04-25 Thread pbreit
I'd say go review the documentation of Stripe or PayMill. You put some 
JavaScript on your payment page. The form submits a "token" to your server 
which you POST to Stripe/Paymill to process the payment. It's all pretty 
easy.

-- 
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: Multiple selection dropdown widget, UI

2016-04-25 Thread Ron Chatterjee
I guess, I can do something similar to this:

https://groups.google.com/forum/#!topic/web2py/miYi2aHXo6A

But doesn't do multiple selection.



On Sunday, April 24, 2016 at 5:16:36 PM UTC-4, Ron Chatterjee wrote:
>
>  duration_str = ('Month or less', '6 months', '1 year')
>
> Field('duration', type='list:string',requires=IS_IN_SET((duration_str), 
> multiple=True),widget=lambda field, value: 
> SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
> label=True)),
>
> This create a multiple selection but the UI is very generic. Wondering if 
> any widget will give me an UI similar to the link below (explained in pic) 
> with tags?
>
> http://semantic-ui.com/modules/dropdown.html
>
> See section
> "Multiple Selection 
>
> A selection dropdown can allow multiple selections
>
> "
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: caching questions

2016-04-25 Thread Pierre

what I was wondering is the type of data of a dynamic app demanding caching 
?
what typically needs caching in such a context ?

-- 
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: _after_delete callback function

2016-04-25 Thread Pierre
thanks Anthony,

I had retrieved your older post

I opted for a "dentist extraction":

p = re.compile(r'[1-9]\d*')
searchObj = p.search(str(Set))

You are right that what's deleted is gone. Howewer without ondelete=cascade 
some other table may still reference the deleted record

-- 
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] Invalid view even created it before

2016-04-25 Thread Morganti
No! I saved the view in the .../view folder, no I moved it to 
.../view/default

Thanks a lot your support!

Best regards
Morganti

Em segunda-feira, 25 de abril de 2016 09:08:34 UTC-3, Anthony escreveu:
>
> And the path to the view is /views/default/novo_cliente.html?
>
> On Monday, April 25, 2016 at 6:32:43 AM UTC-4, Morganti wrote:
>>
>> Hi, thanks your answer.
>>
>> I had created the controller inside default.py, see below:
>> def novo_cliente():
>> db.cliente.salao.default = auth.user.id
>> db.cliente.salao.writable = db.cliente.salao.readable = False
>> form = SQLFORM(db.cliente)
>> if form.process().accepted:
>> response.flash = 'Novo cliente cadastrado'
>>
>> records = 
>> SQLTABLE(db().select(db.cliente.ALL),headers='fieldname:capitalize')
>> return dict(form=form, records=records)
>>
>> and then create the view  novo_cliente.html
>>
>> {{extend 'layout.html}}
>>
>> Novo Cliente
>> {{=form}}
>> Clientes
>> {{=records}}
>>
>>
>> So, what is it missing?
>>
>> Thanks in advance.
>> BR
>> Morganti
>>
>> Em segunda-feira, 25 de abril de 2016 06:57:18 UTC-3, Johann Spies 
>> escreveu:
>>>
>>> Hallo André
>>>
>>> On 25 April 2016 at 11:49, Morganti  wrote:
>>>
>>>
 Hello,

 I am started to learn web2py some weeks ago. After created some 
 controllers and models using the generic view. I tried to deploy to 
 PythonAnywhere to test it and, of course, I know or use disable generic 
 only localhost or create the specific views. First I tried to disable the 
 localhost generic view and ok, everything as expect. But, when I create a 
 view, using quick examples, one view for one form sqlformat, I am getting 
 the error:

 invalid view (default/novo_cliente.html)

 Do I need to do anything more?



>>> Create a view for controller novo_cliente: default/novo_cliente.html
>>>
>>> Regards
>>> Johann
>>> -- 
>>> Because experiencing your loyal love is better than life itself, 
>>> my lips will praise you.  (Psalm 63:3)
>>>
>>

-- 
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] Ajax Form Update (and thank you for all the help)

2016-04-25 Thread Mark Billion
I have a form that is accessed through ajax and displayed in a 
modalRight now, on success, the modal clears and the parent page is 
reloaded, which then shows the data that was entered in the table.

i.e., 

ajax_form = SQLFORM(...).process(next = URL('default', page_name))

{{for x in y:}}

x.idx.attr1x.attr2

{{pass}}


I want to prevent the parent from reloading and update the parent page via 
ajax on form success to include the data that is entered.  Can anyone point 
me to a script I can modify?

-- 
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.factory Pre-Submit Processing Using JavaScript

2016-04-25 Thread Eliot Simcoe
I have a component that has a payment form that uses the Authorize.net 
gateway. I want to be able to display a bootstrap modal dialog with payment 
confirmation information before the form is actually submitted, but after 
the user clicks the submit button.

single_payment_form = SQLFORM.factory(
Field('tenant_name','string',label="Tenant Name",length=
255),
Field('payment_amount', 'decimal(10,2)', label="Payment Amount", 
requires=IS_DECIMAL_IN_RANGE(0, None, "Enter a positive dollar amount"), 
widget=CurrencyWidget.With_Symbol('$')),
Field('payment_method', 'string',label="Payment Method", 
requires=IS_IN_SET(payment_methods, zero='Please add a Payment Method to 
make payments' if not payment_methods else None), length=20),
table_name = "single_payment_form",
_onsubmit="return confirm_payment();",
submit_button = "Continue")

# process the single payment form
if single_payment_form.process(keepvalues=False).accepted:
...

I tried to set my onsubmit form attribute to a javascript function that 
will display the modal dialog, and cancel the form submission by returning 
false. When the user clicks the Edit Payment button on the modal dialog, 
the form should be re-enabled, but not submitted. Also it should not be 
reloaded. When the user clicks the submit payment button the form should be 
submitted normally and reloaded:


  

  
Payment Confirmation
  
  
  confirmation stuff
  
  
  Edit Payment
  Submit Payment
  

  



function confirm_payment() {
$('#payment-confirmation-dialog').modal({
show: true,
backdrop: 'static',
keyboard: false
});

return false;
}

function edit_payment() {
var $form = $('#single_payment_form_component form');

$('#payment-confirmation-dialog').modal('hide');

$.web2py.enableFormElements($form);
}

function submit_payment() {
var $form = $('#single_payment_form_component form');

$('#payment-confirmation-dialog').modal('hide');
$form.submit(function () { return true; });
$form.submit();
}


For some reason, my component is always submitted and reloaded... Always... 
even if I set the form's _onsubmit="return false;"

How can I stop the component from submitting and reloading when the submit 
button is pressed?

Thanks,
Eliot

-- 
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: caching questions

2016-04-25 Thread Anthony
On Monday, April 25, 2016 at 5:38:19 AM UTC-4, Pierre wrote:
>
> Hi everyone,
>
> I discovered this in the book:
>
>
> "The select method has an optional cacheable argument, normally set to 
> False. When cacheable=True the resulting Rows is serializable but The Rows 
> lack update_record and delete_record methods.
>
> If you do not need these methods you can speed up selects a lot by setting 
> the cacheable attribute:
>
>
> *rows = db(query).select(cacheable=True)*"
>
> what's the difference (what makes it faster) between a normal select and the 
> above select ?
>
>
It just takes less time to construct each Row object because it doesn't 
contain those extra attributes.
 

> given the dynamic nature of a database app is the caching mechanism reserved 
> for static/pseudo-static content ?
>
>
The "cacheable" argument doesn't actually do any caching, it just makes it 
so the resulting Rows object itself is cacheable (should you choose to 
cache it). It can still be useful to set cacheable=True for the increased 
speed, even if you aren't doing any caching.

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: _after_delete callback function

2016-04-25 Thread Anthony
Although the Set object is passed to the after_delete callback, you cannot 
retrieve the deleted records (or their IDs) because, well, they have been 
deleted. If you need to know which records will be deleted, you should use 
the before_delete callback.

Note, from the Set object, you can obtain the Query object, which you might 
then be able to inspect to determine the record ID if the query itself 
contains the ID -- 
see https://groups.google.com/d/msg/web2py/M4_5THMHzH0/VehdDI_Xd7MJ.

Anthony

On Monday, April 25, 2016 at 6:29:06 AM UTC-4, Pierre wrote:
>
> Hi,
>
> as stated in the book the function takes a single Set argument which is a 
> Lazy Set 
>
> >>> db.person._after_delete.append(lambda s: pprint(s))
>
> The deleted record's id is probably contained in the Set but how to extract 
> it from there ?.
> I need this id to perform the subsequent actions
>
>
>

-- 
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] Invalid view even created it before

2016-04-25 Thread Anthony
And the path to the view is /views/default/novo_cliente.html?

On Monday, April 25, 2016 at 6:32:43 AM UTC-4, Morganti wrote:
>
> Hi, thanks your answer.
>
> I had created the controller inside default.py, see below:
> def novo_cliente():
> db.cliente.salao.default = auth.user.id
> db.cliente.salao.writable = db.cliente.salao.readable = False
> form = SQLFORM(db.cliente)
> if form.process().accepted:
> response.flash = 'Novo cliente cadastrado'
>
> records = 
> SQLTABLE(db().select(db.cliente.ALL),headers='fieldname:capitalize')
> return dict(form=form, records=records)
>
> and then create the view  novo_cliente.html
>
> {{extend 'layout.html}}
>
> Novo Cliente
> {{=form}}
> Clientes
> {{=records}}
>
>
> So, what is it missing?
>
> Thanks in advance.
> BR
> Morganti
>
> Em segunda-feira, 25 de abril de 2016 06:57:18 UTC-3, Johann Spies 
> escreveu:
>>
>> Hallo André
>>
>> On 25 April 2016 at 11:49, Morganti  wrote:
>>
>>
>>> Hello,
>>>
>>> I am started to learn web2py some weeks ago. After created some 
>>> controllers and models using the generic view. I tried to deploy to 
>>> PythonAnywhere to test it and, of course, I know or use disable generic 
>>> only localhost or create the specific views. First I tried to disable the 
>>> localhost generic view and ok, everything as expect. But, when I create a 
>>> view, using quick examples, one view for one form sqlformat, I am getting 
>>> the error:
>>>
>>> invalid view (default/novo_cliente.html)
>>>
>>> Do I need to do anything more?
>>>
>>>
>>>
>> Create a view for controller novo_cliente: default/novo_cliente.html
>>
>> Regards
>> Johann
>> -- 
>> Because experiencing your loyal love is better than life itself, 
>> my lips will praise you.  (Psalm 63:3)
>>
>

-- 
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] How to add payment integration in web2py?

2016-04-25 Thread Emmanuel Dsouza
-- 
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] Invalid view even created it before

2016-04-25 Thread Morganti
Hi, thanks your answer.

I had created the controller inside default.py, see below:
def novo_cliente():
db.cliente.salao.default = auth.user.id
db.cliente.salao.writable = db.cliente.salao.readable = False
form = SQLFORM(db.cliente)
if form.process().accepted:
response.flash = 'Novo cliente cadastrado'

records = 
SQLTABLE(db().select(db.cliente.ALL),headers='fieldname:capitalize')
return dict(form=form, records=records)

and then create the view  novo_cliente.html

{{extend 'layout.html}}

Novo Cliente
{{=form}}
Clientes
{{=records}}


So, what is it missing?

Thanks in advance.
BR
Morganti

Em segunda-feira, 25 de abril de 2016 06:57:18 UTC-3, Johann Spies escreveu:
>
> Hallo André
>
> On 25 April 2016 at 11:49, Morganti  
> wrote:
>
>
>> Hello,
>>
>> I am started to learn web2py some weeks ago. After created some 
>> controllers and models using the generic view. I tried to deploy to 
>> PythonAnywhere to test it and, of course, I know or use disable generic 
>> only localhost or create the specific views. First I tried to disable the 
>> localhost generic view and ok, everything as expect. But, when I create a 
>> view, using quick examples, one view for one form sqlformat, I am getting 
>> the error:
>>
>> invalid view (default/novo_cliente.html)
>>
>> Do I need to do anything more?
>>
>>
>>
> Create a view for controller novo_cliente: default/novo_cliente.html
>
> Regards
> Johann
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>

-- 
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] _after_delete callback function

2016-04-25 Thread Pierre
Hi,

as stated in the book the function takes a single Set argument which is a Lazy 
Set 

>>> db.person._after_delete.append(lambda s: pprint(s))

The deleted record's id is probably contained in the Set but how to extract it 
from there ?.
I need this id to perform the subsequent actions


-- 
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: Scheduler not finding module

2016-04-25 Thread peter
I am afraid I have one of those horrible intermittent problems. The system 
used to work fine, and then this problem arose when it was moved from one 
node to another. I have rebooted and the system remained. I tried your two 
tests and it passed both. I rebooted, and the problem has disappeared. I 
hate not getting to the bottom of problems even when they appear to go 
away. 

Thanks again for your help Niphlod. Clearly it could well   be an envelope 
issue. I had hoped that by explicitly using 'python2.6' the same python 
would always be used.

Peter 

-- 
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] Invalid view even created it before

2016-04-25 Thread Johann Spies
Hallo André

On 25 April 2016 at 11:49, Morganti  wrote:


> Hello,
>
> I am started to learn web2py some weeks ago. After created some
> controllers and models using the generic view. I tried to deploy to
> PythonAnywhere to test it and, of course, I know or use disable generic
> only localhost or create the specific views. First I tried to disable the
> localhost generic view and ok, everything as expect. But, when I create a
> view, using quick examples, one view for one form sqlformat, I am getting
> the error:
>
> invalid view (default/novo_cliente.html)
>
> Do I need to do anything more?
>
>
>
Create a view for controller novo_cliente: default/novo_cliente.html

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 
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: Helping with dropdown list using query

2016-04-25 Thread Morganti
Hi,

Thanks your helping.

I got it running as expected.

BR
Morganti
Em sexta-feira, 22 de abril de 2016 15:45:53 UTC-3, 黄祥 escreveu:
>
> pls try :
> db.servicos_feitos.servico_feito.requires = 
> IS_IN_DB(db((db.servico_oficina.id_salao == auth.user_id) & 
> (db.servico_oficina.servico_salao == db.tipo_servicos.id) ), 
> db.servico_oficiona.id, db.servico_oficiona._format)
>
> not sure because i don't see db.servico_oficina.id_salao on your table 
> definition.
>
> 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] Invalid view even created it before

2016-04-25 Thread Morganti

Hello,

I am started to learn web2py some weeks ago. After created some controllers 
and models using the generic view. I tried to deploy to PythonAnywhere to 
test it and, of course, I know or use disable generic only localhost or 
create the specific views. First I tried to disable the localhost generic 
view and ok, everything as expect. But, when I create a view, using quick 
examples, one view for one form sqlformat, I am getting the error:

invalid view (default/novo_cliente.html)

Do I need to do anything more?

Thank you in advance.
Best regards
André

-- 
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] caching questions

2016-04-25 Thread Pierre
Hi everyone,

I discovered this in the book:


"The select method has an optional cacheable argument, normally set to False. 
When cacheable=True the resulting Rows is serializable but The Rows lack 
update_record and delete_record methods.

If you do not need these methods you can speed up selects a lot by setting 
the cacheable attribute:


*rows = db(query).select(cacheable=True)*"

what's the difference (what makes it faster) between a normal select and the 
above select ?

given the dynamic nature of a database app is the caching mechanism reserved 
for static/pseudo-static content ?



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