[web2py] Re: redirect an upload

2017-06-12 Thread Dave S

[continuing the subthread on broken pipes]

On Friday, June 2, 2017 at 6:11:05 PM UTC-7, Dave S muttered and muttered:
 

> A winnders client, using wininet, just keeps sending to port 80. 
>>>
>> I'm trying to get tcpdump to tell me if the redirect is sent; my first 
>>> attempts don't see it.
>>>
>>
>> This is because the POST has to be completely sent before this technique 
>> works, and my wininet clients don't seem to cleanly end the send.  Some 
>> minutes after the client tells the user that it is done, Rocket throws up 
>> its hands and says "broken pipe". (I've a group post about that, probably 
>> sometime last year). 
>>
>
> Looks like that's about 10 minutes.  The POST DATA sits in a tmp file 
> during that time; if my app accepts the data it gets moved into the uploads 
> directory, if I don't (as when I'm trying to do a redir) it gets rm'd.
>  
>
 
This does not happen if the upload file is in the neighborhood of 16K, but 
does happen if it is 8M.  I'm not sure what the threshold is for exhibiting 
this behavior.  I may poke around to narrow it down more.

/dps






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


[web2py] Re: query re grid signature

2017-06-12 Thread Peter
That sorted it Stefan - Thanks !
(one more thing to remember when I'm migrating the app to the cloud or I 
might just leave it as it as doesn't seem to get in the way of anything).

Regards
Peter

On Tuesday, 13 June 2017 02:16:25 UTC+1, 黄祥 wrote:
>
> i think it's normal, seems you didn't put user_signature=False during 
> define SQLFORM.grid (the default and recommended user_signature=True)
> for session_secure(), i think it's not related with user_signature, it's 
> just set the session cookie to be secure cookie and ensure web app using 
> https.
>
> ref:
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid
> http://web2py.com/books/default/chapter/29/04/the-core#session
>
> 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: query re grid signature

2017-06-12 Thread 黄祥
i think it's normal, seems you didn't put user_signature=False during 
define SQLFORM.grid (the default and recommended user_signature=True)
for session_secure(), i think it's not related with user_signature, it's 
just set the session cookie to be secure cookie and ensure web app using 
https.

ref:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid
http://web2py.com/books/default/chapter/29/04/the-core#session

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: contact form with attachments

2017-06-12 Thread Dave S


On Saturday, June 10, 2017 at 5:56:19 AM UTC-7, Diego Tostes wrote:
>
> Hi,
>
> how can i send to a controller the attachment file from a html form in my 
> view?
>
> Rgds
>
> Diego
>

-- 
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] query re grid signature

2017-06-12 Thread Peter

This comes up in the url for a page with a grid...
 
*default/apply_payment_to_multiple?_signature=8f626b099c6cd28faa2a6e91c8b86e5ab2d3f2ce*

The '_signature' is something I have not seen before and maybe its 
something I accidentally caused.

The book says

When generating a URL, you have the option to digitally sign it. This will
> append a _signature GET variable that can be verified by the server.
>


web2py is running on my local machine with no HTTPS 

but I may have inadvertently enabled

#session.secure()


around the first time the grid was used - is that the reason?
or is it just normal with a grid?


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


[web2py] Re: Trying to use a variable as a field name in a table insert

2017-06-12 Thread Peter


> I don't think I said anything was "non pythonic" (I identified some *invalid 
> *code -- but that code literally doesn't work at all, it is not merely 
> non-Pythonic).
>
The above code was my suggested (working) alternative, and I think the use 
> of dictionary unpacking would be considered Pythonic.
>
 
Absolutely no argument from me Anthony. 
I simply didn't fully understand - that's on me - but thanks to you, taking 
the time to explain, I understand more now.  

If I haven't said it before... 
*I really do appreciate the time and effort you and others give to the 
forum and noobs like me - I'd be lost without it!*

Incidentally, I may have another query to post, so hoping for some more 
support shortly!

Regards
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] Re: Future of web2py

2017-06-12 Thread Richard Vézina
Massimo's has propose an example with ractive JS call W3 long time ago
which show case basically what you ask for... Look web2p/W3 or massimo/W3
on github...

Richard

On Mon, Jun 12, 2017 at 2:59 PM, Brendan Barnwell 
wrote:

> You can put anything that would go on a full page (including any form) in
>> an Ajax component. Forms in components are submitted via Ajax (they are no
>> less "real" than forms loaded in full pages), and only the component itself
>> refreshes upon submission. It is not quite clear what else you are looking
>> for.
>>
>>
> To give a concrete example, one thing I long for is client-side versions
> of all the validators that are validating based only on the form (that is,
> the "shape") of the data.  A validator for something like a phone number or
> email address is just looking at the textual structure of the data, and it
> would be nice for that to be done client side and show a nice error ("enter
> a valid email" or whatever) before the form is ever submitted.  This would
> not replace server-side validation, and some kinds of checks can only be
> done server side (e.g., if you want to make sure the address is not just
> syntactically valid but actually exists in the DB).  But having client-side
> validators built in (and known to be equivalent/compatible with the
> server-side ones) would be really nice.
>
> --
> 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: web2py 2.15.1

2017-06-12 Thread Richard Vézina
Here :
https://github.com/web2py/web2py/commit/0205594f0853680e7c548dd0c506640958e36f1b

Just go to : welcome/default/test_flatpickr, a dummy form with the 3 field
types date, datetime, time demo

Meaningful changes are mostly at the top and the bottom of diff...

Remain to manger i18n and figure out what to do with datetime... I think
date is correct and time if default widget config with seconds is
acceptable we are done. For datetime as mention it more complexe... Maybe
we could propose enhancement to flatpickr to support default web2py style
datetime formatting like '%Y-%m-%d %H:%M:%S'... Calendar was supporting
that... But I am not sure if there is any standard way to specify datetime
string format??

Richard

On Mon, Jun 12, 2017 at 3:47 PM, Richard Vézina  wrote:

> Ok, I figure this out, I mean it work with only change into web2py.js and
> web2py_ajax.html with web2py-master (up to date)...
>
> I should remove reference to web2py_ajax.js in this comment and replace it
> with web2py.js I guess??
>
> Have you any input regarding the previous message about flatpickr
> integration and backward compatibility...
>
> I will share the mods I made so far from my fork and share the a link
> pointing to it here ASAP.
>
> Richard
>
> On Mon, Jun 12, 2017 at 3:43 PM, Anthony  wrote:
>
>> On Monday, June 12, 2017 at 2:28:21 PM UTC-4, Richard wrote:
>>>
>>> Also, I am not sure what happen with web2py_ajax.*js *I found reference
>>> to it in web2py_ajax*.html*
>>>
>>
>> You must have a very old version -- web2py_ajax.js was changed to
>> web2py.js a long time ago.
>>
>> 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.
>>
>
>

-- 
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: Trying to use a variable as a field name in a table insert

2017-06-12 Thread Anthony
On Monday, June 12, 2017 at 2:11:12 PM UTC-4, Peter wrote:
>
>
> Re:
> What's wrong with this approach
> db.payment_allocations.insert(**{'payment_ref': payment.id,
>  ref_field: record.id,
>  'amount_allocated': allocation})
>
> To be honest I was trying to up my game with a bit of abstraction but 
> haven't used the ** kwargs much (I don't think at all in web2py), 
> so with my limited understanding I thought it fell into the 'non pythonic' 
> category you mentioned,
>

I don't think I said anything was "non pythonic" (I identified some *invalid 
*code -- but that code literally doesn't work at all, it is not merely 
non-Pythonic). The above code was my suggested (working) alternative, and I 
think the use of dictionary unpacking would be considered Pythonic.

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.


Re: [web2py] Re: web2py 2.15.1

2017-06-12 Thread Richard Vézina
Ok, I figure this out, I mean it work with only change into web2py.js and
web2py_ajax.html with web2py-master (up to date)...

I should remove reference to web2py_ajax.js in this comment and replace it
with web2py.js I guess??

Have you any input regarding the previous message about flatpickr
integration and backward compatibility...

I will share the mods I made so far from my fork and share the a link
pointing to it here ASAP.

Richard

On Mon, Jun 12, 2017 at 3:43 PM, Anthony  wrote:

> On Monday, June 12, 2017 at 2:28:21 PM UTC-4, Richard wrote:
>>
>> Also, I am not sure what happen with web2py_ajax.*js *I found reference
>> to it in web2py_ajax*.html*
>>
>
> You must have a very old version -- web2py_ajax.js was changed to
> web2py.js a long time ago.
>
> 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.
>

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

2017-06-12 Thread Anthony
On Monday, June 12, 2017 at 2:28:21 PM UTC-4, Richard wrote:
>
> Also, I am not sure what happen with web2py_ajax.*js *I found reference 
> to it in web2py_ajax*.html*
>

You must have a very old version -- web2py_ajax.js was changed to web2py.js 
a long time ago.

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: Future of web2py

2017-06-12 Thread Anthony
On Monday, June 12, 2017 at 2:59:42 PM UTC-4, Brendan Barnwell wrote:
>
> You can put anything that would go on a full page (including any form) in 
>> an Ajax component. Forms in components are submitted via Ajax (they are no 
>> less "real" than forms loaded in full pages), and only the component itself 
>> refreshes upon submission. It is not quite clear what else you are looking 
>> for.
>>
>>
> To give a concrete example, one thing I long for is client-side versions 
> of all the validators that are validating based only on the form (that is, 
> the "shape") of the data.  A validator for something like a phone number or 
> email address is just looking at the textual structure of the data, and it 
> would be nice for that to be done client side and show a nice error ("enter 
> a valid email" or whatever) before the form is ever submitted.  This would 
> not replace server-side validation, and some kinds of checks can only be 
> done server side (e.g., if you want to make sure the address is not just 
> syntactically valid but actually exists in the DB).  But having client-side 
> validators built in (and known to be equivalent/compatible with the 
> server-side ones) would be really nice.
>

Got it, but that's not what you described in your previous post. web3py 
will likely work more like this.

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: Future of web2py

2017-06-12 Thread Brendan Barnwell

>
> You can put anything that would go on a full page (including any form) in 
> an Ajax component. Forms in components are submitted via Ajax (they are no 
> less "real" than forms loaded in full pages), and only the component itself 
> refreshes upon submission. It is not quite clear what else you are looking 
> for.
>
>
To give a concrete example, one thing I long for is client-side versions of 
all the validators that are validating based only on the form (that is, the 
"shape") of the data.  A validator for something like a phone number or 
email address is just looking at the textual structure of the data, and it 
would be nice for that to be done client side and show a nice error ("enter 
a valid email" or whatever) before the form is ever submitted.  This would 
not replace server-side validation, and some kinds of checks can only be 
done server side (e.g., if you want to make sure the address is not just 
syntactically valid but actually exists in the DB).  But having client-side 
validators built in (and known to be equivalent/compatible with the 
server-side ones) would be really nice.

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

2017-06-12 Thread Richard Vézina
Also, I am not sure what happen with web2py_ajax.*js *I found reference to
it in web2py_ajax*.html*

quote:

// These variables are used by the web2py_ajax_init function in
web2py_ajax.js (which is loaded below).

But it seems to have been removed??

I try to search the list and github for explanations without success...

Richard

On Mon, Jun 12, 2017 at 2:23 PM, Richard Vézina  wrote:

> I made some progress... It relatively straigh foward to replace Calendar...
>
> I am reading IS_TIME() validator which handle time with second or not... I
> am not sure how I could translate that with time picker from flatpicker
> which use enableSeconds boolean flag to determine if it requires second or
> not in the widget... web2py IS_TIME() surely handle both, but should I set
> as a default for time picker to include seconds... If we don't I am not
> sure web2py end users can specify flatpickr to support second without
> having to go in web2py.js and set enableSeconds to "true"... I would say it
> better to just manualy erase second in the input field than not having
> access to the feature at all from the widget???! What do you think?
>
> It similar for datetime... Flatpickr don't support this way of configuring
> the time part : '%Y-%m-%d %H:%M:%S'. Date and time are configure separatly,
> I work around in a backward compatible way the date part by stripping all
> the "%" as Flatpickr use "Y-m-d" format specification instead of "%Y-%m-%d"
> in case of date type field. But datetime type field is more difficult to
> manage... I guess we will need to write some logic in js to parse web2py
> datetime configuration string to set flatpickr default time flags properly
> which is a tedious task...
>
> I will have look at internationalization...
>
> Richard
>
>
>
>
> On Fri, Jun 9, 2017 at 3:17 AM, Jörg Schneider 
> wrote:
>
>> +1
>>
>> --
>> 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: web2py 2.15.1

2017-06-12 Thread Richard Vézina
I made some progress... It relatively straigh foward to replace Calendar...

I am reading IS_TIME() validator which handle time with second or not... I
am not sure how I could translate that with time picker from flatpicker
which use enableSeconds boolean flag to determine if it requires second or
not in the widget... web2py IS_TIME() surely handle both, but should I set
as a default for time picker to include seconds... If we don't I am not
sure web2py end users can specify flatpickr to support second without
having to go in web2py.js and set enableSeconds to "true"... I would say it
better to just manualy erase second in the input field than not having
access to the feature at all from the widget???! What do you think?

It similar for datetime... Flatpickr don't support this way of configuring
the time part : '%Y-%m-%d %H:%M:%S'. Date and time are configure separatly,
I work around in a backward compatible way the date part by stripping all
the "%" as Flatpickr use "Y-m-d" format specification instead of "%Y-%m-%d"
in case of date type field. But datetime type field is more difficult to
manage... I guess we will need to write some logic in js to parse web2py
datetime configuration string to set flatpickr default time flags properly
which is a tedious task...

I will have look at internationalization...

Richard




On Fri, Jun 9, 2017 at 3:17 AM, Jörg Schneider  wrote:

> +1
>
> --
> 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: Trying to use a variable as a field name in a table insert

2017-06-12 Thread Peter

Re:
What's wrong with this approach
db.payment_allocations.insert(**{'payment_ref': payment.id,
 ref_field: record.id,
 'amount_allocated': allocation})

To be honest I was trying to up my game with a bit of abstraction but 
haven't used the ** kwargs much (I don't think at all in web2py), 
so with my limited understanding I thought it fell into the 'non pythonic' 
category you mentioned, though I do understand it is passing 
a dictionary of values as opposed to over-riding an expected variable as in 
my earlier case.

Will give it a go so, thanks Anthony!

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


[web2py] Re: checking pg_stat_activity shows a lot of "SET standard_conforming_strings=on;" idle in transaction

2017-06-12 Thread Mick
No problems that I can tell, but they seem to be persistent, I have 5 
databases and 5 idle transactions "SET standard conforming strings=on;" 
that don't seem to be recycled, every time I check pg_stat_activity they're 
there.  I have other applications accessing the database, and I'm trying to 
avoid exceeding the max number of connections...

On Sunday, June 11, 2017 at 12:31:27 AM UTC-7, Massimo Di Pierro wrote:
>
> web2py uses connection pooling and recycles connections. I do not think 
> there is a problem. 
> Does it causes any problem for you?
>
> On Thursday, 8 June 2017 13:49:03 UTC-5, Mick wrote:
>>
>> Why is this happening?  Is this creating a new connection to the database 
>> or is it reusing an existing connection?  Can I prevent that from happening?
>> Thank you in advance
>>
>>

-- 
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 filtering with local and external table

2017-06-12 Thread J-Michel Angers
Oh Yes !
Instead of an algorythm with variables and loops and
I saw this "belongs", but I hadn't imagined that it was the as the "IN" of 
a select...
Thank you very much. I appologized, not to understand this myself :):):)

-- 
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: Future of web2py

2017-06-12 Thread António Ramos
+1 agreed.
Lets remove some pressure from Massimo...
Too much noise can harm the baby...



2017-06-12 15:03 GMT+01:00 Richard Vézina :

> Karoly,
>
> 1) Massimo had already mention that web2py will be supported by the core
> team. You should know that core team much more involve in the maintenance
> and enhancement of web2py lately than Massimo is. I am rely confident in
> the maintenance of web2py for a fading out period if web3py will get
> traction. If web3py don't get traction, I am pretty sure that web2py will
> still continue to have a large user base and good core team to at least
> keep thing working.
>
> 2) Only Massimo can answer that, but I am confident that it will consider
> this aspect, clear and easy path to transition from w2p to w3p... So there
> should be a simple way to refactor your app to migrate it to web3py. But
> web3py will brake backward compatibility, so you have to expect to have
> major refactoring to do what exactly will be known when the time comes.
>
> Richard
>
> On Mon, Jun 12, 2017 at 3:39 AM, Karoly Kantor  wrote:
>
>>
>>
>> For people to feel they have an understanding on the web2py roadmap and
>> trust in in its future, i think it would be important to get clear answers
>> to the following questions:
>>
>> 1. When "web3py" is released, what will happen to web2py? Will it come to
>> an end of life, or will the two frameworks continue to be maintained
>> parallel?
>>
>> 2. What will be the relationship between web2py and web3py? I would guess
>> that contributors' efforts will shift to web3py, so what happens to
>> existing web2py based applications? Will there be an upgrade path with
>> reasonable effort, of will those apps be stuck with an old framework from
>> which contributor effort has shifted away?
>>
>>
>>
>>>
>>> Just to be clear, web2py 2.15.1 will be released in the next few days
>>> and will support Python 3. It is still web2py, just with Python 3 support
>>> and a number of other updates and fixes. web3py will be a completely
>>> new framework (also supporting Python 3), quite different from web2py. It
>>> is not close to ready for release.
>>>
>>> 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.
>>
>
> --
> 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: SQLFORM.grid filtering with local and external table

2017-06-12 Thread Anthony
You probably want .belongs() with a nested ._select(), as shown here: 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs

Anthony

On Monday, June 12, 2017 at 10:27:43 AM UTC-4, J-Michel Angers wrote:
>
> Hi,
> My app goes forward, I have plaisure to develop with web2py.
> But sometimes I don't find myself the solution for very specific search.
>
> My app works well now, I can fill a request, add/remove parts, add/remove 
> attached, calculate price, send this request to collect signatures 
> Now I try to display in the first "index" page (a SQLFORM.grid), only the 
> requests that interest the user who is at the keybord (for the guitar it's 
> someone else).
> The criteria are :
>  * only the requests that are not closed (and another page or another 
> filter to display old closed requests)
>  * only the requests that were written by this user
>  *  OR the requests that this user HAS already signed OR those that this 
> user HAS TO sign OR those that this user WILL HAVE to sign.
> A request (table = "Demande") has to be signed by many persons and 
> managers (not always the same) => table = "Workflow" (shortcut TDW).
>
> In the first version of my app, each user see all the requests (not 
> closed), and the SQLFORM.grid works well.
> form = SQLFORM.grid((dbW.Demande.Statut!='Close'), ...)
> In the second version, the user can see his own requests (that he has 
> created) AND also those he HAS TO sign.
> form = SQLFORM.grid((dbW.Demande.Statut!='Close') &
>   ((dbW.Demande.CreatedBy==session.CurrentUser)
>   |(dbW.Demande.NextSign==session.CurrentUser)),
> But now I want to show also the requests that he HAS already signed, OR 
> requests that he WILL HAVE to sign.
> FIRST TRY :
> form = SQLFORM.grid((dbW.Demande.Statut!='Close') &
>   ((dbW.Demande.CreatedBy==session.CurrentUser)
>   |(dbW.Demande.NumDA in (select NumDA from TDW 
> where Responsable==session.CurrentUser)),
> I already knew that this syntax doesn't work.
>
> SECOND TRY :
> liste_DA_filtre = []
> for DA in dbW(dbW.TDW.Responsable==session.CurrentUser).select(dbW.TDW
> .NumDA):
> liste_DA_filtre.append(DA.NumDA)
> form = SQLFORM.grid((dbW.Demande.Statut!='Close') &
>   ((dbW.Demande.CreatedBy==session.CurrentUser)
>   |(dbW.Demande.NumDA in  liste_DA_filtre)),
> Is there any way to do a "in()" ?
>
> THIRD TRY :
> liste_DA_filtre = []
> for DA in dbW(dbW.TDW.Responsable==session.CurrentUser).select(dbW.TDW
> .NumDA):
> liste_DA_filtre.append(DA.NumDA)
> selection_DA = dbW(dbW.WFDA_DemAchat).select().find(
>  lambda row: row.Statut!='Close' and (row.CreatedBy==session.
> CurrentUser or row.NumDA in liste_DA_filtre))
> form = SQLFORM.grid((selection_DA, ...)
> I know that this syntax is not correct : SQLFORM.gris needs a request, not 
> a set of data.
> But I wrote this only to check the data that are filtered... and this is 
> exactly the rows I'm looking for.
>

-- 
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 filtering with local and external table

2017-06-12 Thread J-Michel Angers
Hi,
My app goes forward, I have plaisure to develop with web2py.
But sometimes I don't find myself the solution for very specific search.

My app works well now, I can fill a request, add/remove parts, add/remove 
attached, calculate price, send this request to collect signatures 
Now I try to display in the first "index" page (a SQLFORM.grid), only the 
requests that interest the user who is at the keybord (for the guitar it's 
someone else).
The criteria are :
 * only the requests that are not closed (and another page or another 
filter to display old closed requests)
 * only the requests that were written by this user
 *  OR the requests that this user HAS already signed OR those that this 
user HAS TO sign OR those that this user WILL HAVE to sign.
A request (table = "Demande") has to be signed by many persons and managers 
(not always the same) => table = "Workflow" (shortcut TDW).

In the first version of my app, each user see all the requests (not 
closed), and the SQLFORM.grid works well.
form = SQLFORM.grid((dbW.Demande.Statut!='Close'), ...)
In the second version, the user can see his own requests (that he has 
created) AND also those he HAS TO sign.
form = SQLFORM.grid((dbW.Demande.Statut!='Close') &
  ((dbW.Demande.CreatedBy==session.CurrentUser)
  |(dbW.Demande.NextSign==session.CurrentUser)),
But now I want to show also the requests that he HAS already signed, OR 
requests that he WILL HAVE to sign.
FIRST TRY :
form = SQLFORM.grid((dbW.Demande.Statut!='Close') &
  ((dbW.Demande.CreatedBy==session.CurrentUser)
  |(dbW.Demande.NumDA in (select NumDA from TDW 
where Responsable==session.CurrentUser)),
I already knew that this syntax doesn't work.

SECOND TRY :
liste_DA_filtre = []
for DA in dbW(dbW.TDW.Responsable==session.CurrentUser).select(dbW.TDW.
NumDA):
liste_DA_filtre.append(DA.NumDA)
form = SQLFORM.grid((dbW.Demande.Statut!='Close') &
  ((dbW.Demande.CreatedBy==session.CurrentUser)
  |(dbW.Demande.NumDA in  liste_DA_filtre)),
Is there any way to do a "in()" ?

THIRD TRY :
liste_DA_filtre = []
for DA in dbW(dbW.TDW.Responsable==session.CurrentUser).select(dbW.TDW.
NumDA):
liste_DA_filtre.append(DA.NumDA)
selection_DA = dbW(dbW.WFDA_DemAchat).select().find(
 lambda row: row.Statut!='Close' and (row.CreatedBy==session.
CurrentUser or row.NumDA in liste_DA_filtre))
form = SQLFORM.grid((selection_DA, ...)
I know that this syntax is not correct : SQLFORM.gris needs a request, not 
a set of data.
But I wrote this only to check the data that are filtered... and this is 
exactly the rows I'm looking for.

-- 
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: Creating a dropdown form for linked tables

2017-06-12 Thread isi_jca
Hi!!!

Look at in this 
link http://www.web2pyslices.com/slice/show/1410/cascading-drop-down-lists

-- 
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: Future of web2py

2017-06-12 Thread Richard Vézina
Karoly,

1) Massimo had already mention that web2py will be supported by the core
team. You should know that core team much more involve in the maintenance
and enhancement of web2py lately than Massimo is. I am rely confident in
the maintenance of web2py for a fading out period if web3py will get
traction. If web3py don't get traction, I am pretty sure that web2py will
still continue to have a large user base and good core team to at least
keep thing working.

2) Only Massimo can answer that, but I am confident that it will consider
this aspect, clear and easy path to transition from w2p to w3p... So there
should be a simple way to refactor your app to migrate it to web3py. But
web3py will brake backward compatibility, so you have to expect to have
major refactoring to do what exactly will be known when the time comes.

Richard

On Mon, Jun 12, 2017 at 3:39 AM, Karoly Kantor  wrote:

>
>
> For people to feel they have an understanding on the web2py roadmap and
> trust in in its future, i think it would be important to get clear answers
> to the following questions:
>
> 1. When "web3py" is released, what will happen to web2py? Will it come to
> an end of life, or will the two frameworks continue to be maintained
> parallel?
>
> 2. What will be the relationship between web2py and web3py? I would guess
> that contributors' efforts will shift to web3py, so what happens to
> existing web2py based applications? Will there be an upgrade path with
> reasonable effort, of will those apps be stuck with an old framework from
> which contributor effort has shifted away?
>
>
>
>>
>> Just to be clear, web2py 2.15.1 will be released in the next few days
>> and will support Python 3. It is still web2py, just with Python 3 support
>> and a number of other updates and fixes. web3py will be a completely new
>> framework (also supporting Python 3), quite different from web2py. It is
>> not close to ready for release.
>>
>> 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.
>

-- 
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: Future of web2py

2017-06-12 Thread Richard Vézina
Please stop making unjustify pressure to the release of web3py... I greatly
prefer that Massimo's take as much as he need time to design it new
framework. It will prevent design flaws that would other than that be
leaved in and make things more difficult to maintain in the future and
require major refactoring or backward compatibility issue. I think it would
be more constructive to share our idea and our expectation, as it will help
Massimo make a better system design.

This answer express my own voice and not represent any of the web2py core
team but just me.

But Malik you keep coming back with pressure for sometimes and I don't find
this press constructive. You could rather share your expectations from the
new framework, I think Massimo has share his thought many time about
web3py, and base on these informations I am sure we can provide
constructive feedback...

Thanks

Richard

On Sun, Jun 11, 2017 at 8:22 PM, Muhammad Hashim Malik <
has...@rehmansoft.com> wrote:

> ​Dear Massimo ​
>
> The posts in this thread are showing desperate frustration for release of
> Web3Py. Please do it now.
>
> People like what web2py is and expect the same from web3py. The only
> expected difference is shift from Python2 to Python3. Its ok, as a
> mastermind of Web2Py/Web3Py, whatever changes you deem necessary in Web3Py.
> Those changes would be acceptable to the community.
>
> *Malik M. Hashim*
> +92-300-3754107 <+92%20300%203754107>
>
>
>
> On Mon, Jun 12, 2017 at 3:41 AM, Brendan Barnwell 
> wrote:
>
>> On Wednesday, June 7, 2017 at 8:16:38 PM UTC-7, tesser...@gmail.com
>> wrote:
>>>
>>> According to github, there were semi-regular releases going back to
>>> 2013, then they stopped about a year ago, so I guess it's only natural for
>>> people to wonder about the status of the project. Personally, I'm wondering
>>> if the project will continue to build production releases in the future. I
>>> see that master still gets some love, so maybe master is now stable for
>>> production and I missed it?
>>>
>>> Anyhow, thank you for all your work on this framework. I admire the
>>> project itself and I think the community speaks for its integrity. I read
>>> your post earlier in this thread on your plans for web3py, and I thought I
>>> would say that as a web2py user, I loved how it gave me a current version
>>> of a few nice libraries and flattened web development into a single Python
>>> layer. Basically it gave me a mostly pre-built good-enough web interface
>>> and let me get on with the business of developing services for users.
>>>
>>>
>> I agree with this as well.  I haven't been using web2py too long, but one
>> of the things I really like about it is how self-contained it is.  Many of
>> the other frameworks involve layers of dependencies on all sorts of things
>> that make it quite onerous to begin.  web2py shines in that regard.
>>
>>
>>> Your web3py post concedes that the days of the flat development stack
>>> are over, and I agree it's unavoidable to use some of the newer JS
>>> components and move a lot of the work to the browser. I haven't checked out
>>> the stack you've listed in your reply yet, but I'll very likely end up
>>> using whatever you put together because I want to keep using helpers,
>>> validators and the DAL. I look forward to the day the lineup is stable
>>> enough for release, and thanks again for your past work on web2py.
>>>
>>>
>> I think it would be unfortunate for the "flat stack" to disappear
>> entirely.  Hopefully a compromise can be reached in which web2py ships (or
>> at least can ship) with a bundle of tested-and-verified-to-work-together
>> dependencies allowing simple installation.
>>
>> Just to add my own perspective on the web3py play Massimo outlined: in my
>> experience, the main weaknesses in web2py are the "magicness" of the
>> import/namespace model, and the lack of comprehensive client/server
>> communication tools.  By the first I mean many of the things I've asked
>> about (and been graciously helped with) over the past several months.  The
>> way that web2py manipulates import paths, executes code per request, and
>> populates namespaces automatically (e.g., making names defined in model
>> code available in controllers) makes many things convenient.  However, the
>> magic underlying this is not fully exposed, meaning that code reuse can
>> become difficult if you stray outside the predefined magic boundaries.
>> It's difficult, for instance, to create modules that factor out db-centric
>> code, because the db object (typically defined in a model file) won't be
>> available; this forces you to reimplement the wheel to some extent by
>> taking the db-creation code out of a plain model file and put it in a
>> function --- which then breaks things like the db-admin tool.  Obviously
>> these are complex issues, but in the end I think it would be ideal to find
>> a way that makes simple things smooth without making more complex code
>> interdependencies 

[web2py] Re: Future of web2py

2017-06-12 Thread Anthony

>
>
>1. *Better token based authentication for apis*
>
> web2py Auth supports JWT tokens.

>
>1. Support of GET and POST requests on login like flask does.
>
> What does this mean?

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: Future of web2py

2017-06-12 Thread Oasis Agano
If possible can we also have this in either *web2py 2.15* or *web3py* or 
both:

   1. *Better applications Unit testing*(Not the framework test) methods 
   and enough documentation
   2. Better Oauth2 support
   3. *Better token based authentication for apis*
   4. Support of GET and POST requests on login like flask does.

Thank you for your time.

kr,

Oasis

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

2017-06-12 Thread Mirek Zvolský
1) pip install sparkpost

2) I have this inside my private/appconfig.ini:
; smtp address and credentials
[smtp]
server = smtp.sparkpostmail.com:587
sender = mojekniho...@mojeknihovna.eu
login  = SMTP_Injection:4dxxx92

3) I have the file modules/mail_send.py with mail_send function (prilohy 
means attachment, prijemci means recipients (default are the testing 
recipients)):
#!/usr/bin/env python
# -*- coding: utf8 -*-

import os
import mimetypes

from sparkpost import SparkPost

appdir = os.path.join(os.getcwd(), 'applications', 'platby')
sparkpost_key = myconf.take('smtp.login').split(':')[-1].strip()

def mail_send(subject, txt, prilohy=[], prijemci=
  [{'email': 'mirek.zvol...@gmail.com', 'name': u'Mirek Zvolský na 
Googlu'},
  {'email': 'zvol...@seznam.cz', 'name': u'Mirek Zvolský na Seznamu'}],
  styl='text'):
'''
subject, txt - nejlépe unicode objekty
prijemci - viz příklad defaultní hodnoty
styl = 'html'/'text'
přílohy je třeba uložit přes FTP do mail_attachments/ a po odeslání 
smazat
'''

attachments = []
for priloha in prilohy:
attachments.append({
'filename': priloha,
'name': os.path.basename(priloha),
'type': mimetypes.guess_type(priloha)[0] or 
'application/octet-stream'
})

stylDict = {styl: txt}
sp = SparkPost(sparkpost_key)
sp.transmissions.send(
recipients=[prijemce['email'] for prijemce in prijemci],
from_email=u'Společné Aktivity ',
subject=subject,
attachments=attachments,
**stylDict
)




Dne neděle 11. června 2017 6:12:57 UTC+2 billmac...@gmail.com napsal(a):
>
> How to integrate SparkPost into web2py? Any info on the api?
>
> What is the mail server setting for SparkPost?
>

-- 
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: Future of web2py

2017-06-12 Thread Karoly Kantor


For people to feel they have an understanding on the web2py roadmap and 
trust in in its future, i think it would be important to get clear answers 
to the following questions:

1. When "web3py" is released, what will happen to web2py? Will it come to 
an end of life, or will the two frameworks continue to be maintained 
parallel?

2. What will be the relationship between web2py and web3py? I would guess 
that contributors' efforts will shift to web3py, so what happens to 
existing web2py based applications? Will there be an upgrade path with 
reasonable effort, of will those apps be stuck with an old framework from 
which contributor effort has shifted away?

 

>
> Just to be clear, web2py 2.15.1 will be released in the next few days and 
> will support Python 3. It is still web2py, just with Python 3 support and a 
> number of other updates and fixes. web3py will be a completely new 
> framework (also supporting Python 3), quite different from web2py. It is 
> not close to ready for release.
>
> 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.