[web2py] Re: Using Stripe's Checkout w/ web2py

2017-03-21 Thread lyn2py
You might need to be more detailed describing your issue. 

On Wednesday, March 22, 2017 at 11:19:21 AM UTC+8, Scott Hunter wrote:
>
> Has anyone been able to use Stripe's Checkout with web2py?  If so, how did 
> you do it?  I'm having trouble getting the token it generates back.
>
> - Scott
>

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

2017-03-21 Thread Kiran Subbaraman
I agree that the managing web2pyslices as issues may be one way to go.A 
couple of options that I have in mind

*Option 1 / bl.ocks.org*
But there is another idea that I have been considering for sometime...
I follow the d3js community once in a while, and they have this nice way to 
contribute and expand on the examples created using d3js. These examples 
are hosted on http://bl.ocks.org. If an example is created on Gist, and 
follows a prescribed template, then it is hosted as an example on 
bl.ocks.org.

The template and process is defined here: https://bl.ocks.org/-/about

The work that the bl.ocks.org application does, needs to be replicated in 
some form by another application in the web2py world (This has similar 
problems - hosting, and computation power, etc)

*Option 2 / Gists, with PR based list*

   - Post a slice on gist
   - Raise a PR, with this link - this is similar to the way one raises PRs 
   to lists such as this - https://github.com/akullpp/awesome-java
   - If someone creates a web2pyslices.github.io on this site, then you 
   have an autogenerated webpage with the curated list of slices.
   

The reason am plugging for Gist based solutions is that it makes 
contribution to that Gist, or improvement in code a possibility (however 
remote). 

On Wednesday, March 22, 2017 at 1:23:16 AM UTC+5:30, Massimo Di Pierro 
wrote:
>
> web2pyslices is becoming hard to maintain. Right now the best solution is 
> to create a github repo and move all the recipes into issues. We will 
> deprecate by closing them. People with gihub accounts can post and comment 
> issues/recipes. Unless you have a better solution, this will be done within 
> the next week.
>
> One sideffect is that we will lose some information about authorship of 
> the recipes and the comments. We will add a notice "created by {...}" but 
> the {...} name will be the web2pyslices username and that may not mean 
> anything in the gihub context.
>
> At this I do not have a better solution but please share your thoughts. 
>
>

-- 
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] Using Stripe's Checkout w/ web2py

2017-03-21 Thread Scott Hunter
Has anyone been able to use Stripe's Checkout with web2py?  If so, how did 
you do it?  I'm having trouble getting the token it generates back.

- Scott

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


{Disarmed} Re: [web2py] Re: web2pyslices

2017-03-21 Thread Carlos Cesar Caballero Díaz
Hi Massimo, I have a base CMS that I have not published because has been 
very difficult to convert it into modules/plugins (right now is used in 
the  www.daxslab.com site), if someone else have not any better option I 
can give a try, but I can't start working to make a proposal until next 
month.


Greetings.

El 21/03/17 a las 20:10, Massimo Di Pierro escribió:
The problem is that web2pyslices is based on Movuca and I do not 
believe Movuca is supported any more. If anybody wants to "adopt" 
web2pyslices as is, the code is available. If anybody wants to develop 
a new CMS for web2pyslices, the data can be converted.


On Tuesday, 21 March 2017 15:33:55 UTC-5, Relsi Maron wrote:


Hi Massimo, what is the major difficult to maintenance? How we can
help?


Em terça-feira, 21 de março de 2017 16:53:16 UTC-3, Massimo Di
Pierro escreveu:

web2pyslices is becoming hard to maintain. Right now the best
solution is to create a github repo and move all the recipes
into issues. We will deprecate by closing them. People with
gihub accounts can post and comment issues/recipes. Unless you
have a better solution, this will be done within the next week.

One sideffect is that we will lose some information about
authorship of the recipes and the comments. We will add a
notice "created by {...}" but the {...} name will be the
web2pyslices username and that may not mean anything in the
gihub context.

At this I do not have a better solution but please share your
thoughts.

--
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 *MailScanner ha detectado un intento de fraude 
en la siguiente p�gina web "groups.google.com". /No/ conf�e en esta 
p�gina web:* 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.


{Disarmed} Re: [web2py] web2pyslices

2017-03-21 Thread Carlos Cesar Caballero Díaz
What is the main problem with the actual web2py slices? is the old 
unmaintainable movuca code or something else?


I think that web2py needs a facelift, a new modern-look main site and a 
new web2pyslices site is needed, but I think that the github idea is a 
step back...


Some time ago I did an initial redesign proposal 
(https://github.com/cccaballero/web2py-examples-proposal) with very 
little feedback, and in some post I commented that we could build a new 
community driven web2pyslices site. I still think that it is the way to go.


Greetings.

El 21/03/17 a las 15:53, Massimo Di Pierro escribió:
web2pyslices is becoming hard to maintain. Right now the best solution 
is to create a github repo and move all the recipes into issues. We 
will deprecate by closing them. People with gihub accounts can post 
and comment issues/recipes. Unless you have a better solution, this 
will be done within the next week.


One sideffect is that we will lose some information about authorship 
of the recipes and the comments. We will add a notice "created by 
{...}" but the {...} name will be the web2pyslices username and that 
may not mean anything in the gihub context.


At this I do not have a better solution but please share your thoughts.

--
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 *MailScanner ha detectado un intento de fraude 
en la siguiente p�gina web "groups.google.com". /No/ conf�e en esta 
p�gina web:* 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: web2pyslices

2017-03-21 Thread Massimo Di Pierro
The problem is that web2pyslices is based on Movuca and I do not believe 
Movuca is supported any more. If anybody wants to "adopt" web2pyslices as 
is, the code is available. If anybody wants to develop a new CMS for 
web2pyslices, the data can be converted. 

On Tuesday, 21 March 2017 15:33:55 UTC-5, Relsi Maron wrote:
>
>
> Hi Massimo, what is the major difficult to maintenance? How we can help?
>
>
> Em terça-feira, 21 de março de 2017 16:53:16 UTC-3, Massimo Di Pierro 
> escreveu:
>>
>> web2pyslices is becoming hard to maintain. Right now the best solution is 
>> to create a github repo and move all the recipes into issues. We will 
>> deprecate by closing them. People with gihub accounts can post and comment 
>> issues/recipes. Unless you have a better solution, this will be done within 
>> the next week.
>>
>> One sideffect is that we will lose some information about authorship of 
>> the recipes and the comments. We will add a notice "created by {...}" but 
>> the {...} name will be the web2pyslices username and that may not mean 
>> anything in the gihub context.
>>
>> At this I do not have a better solution but please share your thoughts. 
>>
>>

-- 
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: edit or delete child or detail table on SQLFORM.grid with left join

2017-03-21 Thread Massimo Di Pierro
The A helper also has a A(..., callback=URL()) that posts to the callback. 
But I think _onclick is more explicit.

On Tuesday, 21 March 2017 16:00:05 UTC-5, 黄祥 wrote:
>
> a, i c, thank you so much for your example massimo, that's why my old code 
> not work because i'm using _href
> e.g.
> def index():
> grid = SQLFORM.grid(db.thing, links=[lambda row: 
> A('check',_onclick="jQuery.post('%s')" % URL('check',args=row.id))])
> #grid = SQLFORM.grid(db.thing, links=[lambda row: 
> A('check',_href=URL('check',args=row.id) ) ] ) # not work use _onclick = 
> jQuery.post()
> return dict(grid=grid)
>
> thanks and 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.


Re: [web2py] web2pyslices

2017-03-21 Thread Ovidio Marinho
It It would be very important that you stay in a job with web2py, since we
are using the tool to make systems and we do not have a repository
developed with web2py. be very important that you stay in a web2py job,
because we are using the tool to make systems and we do not have a
repository developed with web2py.

Em terça-feira, 21 de março de 2017, Massimo Di Pierro <
massimo.dipie...@gmail.com> escreveu:

> web2pyslices is becoming hard to maintain. Right now the best solution is
> to create a github repo and move all the recipes into issues. We will
> deprecate by closing them. People with gihub accounts can post and comment
> issues/recipes. Unless you have a better solution, this will be done within
> the next week.
>
> One sideffect is that we will lose some information about authorship of
> the recipes and the comments. We will add a notice "created by {...}" but
> the {...} name will be the web2pyslices username and that may not mean
> anything in the gihub context.
>
> At this I do not have a better solution but please share your thoughts.
>
> --
> 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.
>


-- 




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

-- 
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: edit or delete child or detail table on SQLFORM.grid with left join

2017-03-21 Thread 黄祥
a, i c, thank you so much for your example massimo, that's why my old code 
not work because i'm using _href
e.g.
def index():
grid = SQLFORM.grid(db.thing, links=[lambda row: 
A('check',_onclick="jQuery.post('%s')" % URL('check',args=row.id))])
#grid = SQLFORM.grid(db.thing, links=[lambda row: 
A('check',_href=URL('check',args=row.id) ) ] ) # not work use _onclick = 
jQuery.post()
return dict(grid=grid)

thanks and 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: web2pyslices

2017-03-21 Thread Relsi Maron

Hi Massimo, what is the major difficult to maintenance? How we can help?


Em terça-feira, 21 de março de 2017 16:53:16 UTC-3, Massimo Di Pierro 
escreveu:
>
> web2pyslices is becoming hard to maintain. Right now the best solution is 
> to create a github repo and move all the recipes into issues. We will 
> deprecate by closing them. People with gihub accounts can post and comment 
> issues/recipes. Unless you have a better solution, this will be done within 
> the next week.
>
> One sideffect is that we will lose some information about authorship of 
> the recipes and the comments. We will add a notice "created by {...}" but 
> the {...} name will be the web2pyslices username and that may not mean 
> anything in the gihub context.
>
> At this I do not have a better solution but please share your thoughts. 
>
>

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

2017-03-21 Thread Massimo Di Pierro
web2pyslices is becoming hard to maintain. Right now the best solution is 
to create a github repo and move all the recipes into issues. We will 
deprecate by closing them. People with gihub accounts can post and comment 
issues/recipes. Unless you have a better solution, this will be done within 
the next week.

One sideffect is that we will lose some information about authorship of the 
recipes and the comments. We will add a notice "created by {...}" but the 
{...} name will be the web2pyslices username and that may not mean anything 
in the gihub context.

At this I do not have a better solution but please share your thoughts. 

-- 
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: Trying to use Field.represent for 'blob' type in SQLFORM.grid (works in appadmin?)

2017-03-21 Thread Massimo Di Pierro
You should be able to donwload the zip version and unzip over the existing 
one (assuming you are running from source). I plan a new release within 
less then 1 month. It is long overdue.


On Tuesday, 21 March 2017 14:17:41 UTC-5, Jordan Myers wrote:
>
> Thanks for the quick fix! Do you know when the next scheduled release will 
> be for web2py? If it's not soon, what is the best practice for cloning the 
> repository into an existing web2py source-download?
>
> On Mon, Mar 20, 2017 at 4:16 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> It is a bug in grid. I just pushed a new version on github that allows 
>> you to do SQLFORM.grid(...,showblob=True)
>>
>>
>> On Monday, 20 March 2017 13:52:53 UTC-5, Jordan Myers wrote:
>>>
>>> Hello,
>>>
>>> I am trying to display a Field that has type 'blob' in a SQLFORM.grid. 
>>> The data is NOT user-uploaded, thus I cannot use the typical uploadfield + 
>>> request.download pattern. I am using blob because I need to store important 
>>> algorithm-generated data that is too large to fit in the 'text' field type. 
>>> I would like it to display a link to a handler.
>>>
>>> I tried a simple test case model
>>>
>>>
>>> db.define_table('blob_test',
>>> Field('blob_field', 'blob', readable=True,
>>>   represent=lambda value, row: A('link', 
>>> _href=URL('handler', args=[row.id]))
>>>   )
>>> )
>>>
>>>
>>> #and in the controller:
>>>
>>> def blob_grid():
>>> response.view = 'generic.html'
>>> grid = SQLFORM.grid(db.blob_test.id > 0)
>>> return dict(grid=grid)
>>>
>>>
>>> The result is that the controller does not display the link, and indeed the 
>>> entire column is overtaken by the default view/edit/delete buttons provided 
>>> by grid.
>>>
>>>
>>> 
>>>
>>>
>>> Interestingly, the appadmin display of the table does have the represent 
>>> link as intended. 
>>>
>>>
>>> 
>>>
>>>
>>>
>>>
>>> How can I have this representation work for SQLFORM.grid? Thanks.
>>>
>>>
>>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/1bO8XUIo0eU/unsubscribe.
>> To unsubscribe from this group and all its topics, 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: Trying to use Field.represent for 'blob' type in SQLFORM.grid (works in appadmin?)

2017-03-21 Thread Jordan Myers
Thanks for the quick fix! Do you know when the next scheduled release will
be for web2py? If it's not soon, what is the best practice for cloning the
repository into an existing web2py source-download?

On Mon, Mar 20, 2017 at 4:16 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> It is a bug in grid. I just pushed a new version on github that allows you
> to do SQLFORM.grid(...,showblob=True)
>
>
> On Monday, 20 March 2017 13:52:53 UTC-5, Jordan Myers wrote:
>>
>> Hello,
>>
>> I am trying to display a Field that has type 'blob' in a SQLFORM.grid.
>> The data is NOT user-uploaded, thus I cannot use the typical uploadfield +
>> request.download pattern. I am using blob because I need to store important
>> algorithm-generated data that is too large to fit in the 'text' field type.
>> I would like it to display a link to a handler.
>>
>> I tried a simple test case model
>>
>>
>> db.define_table('blob_test',
>> Field('blob_field', 'blob', readable=True,
>>   represent=lambda value, row: A('link', 
>> _href=URL('handler', args=[row.id]))
>>   )
>> )
>>
>>
>> #and in the controller:
>>
>> def blob_grid():
>> response.view = 'generic.html'
>> grid = SQLFORM.grid(db.blob_test.id > 0)
>> return dict(grid=grid)
>>
>>
>> The result is that the controller does not display the link, and indeed the 
>> entire column is overtaken by the default view/edit/delete buttons provided 
>> by grid.
>>
>>
>> 
>>
>>
>> Interestingly, the appadmin display of the table does have the represent 
>> link as intended.
>>
>>
>> 
>>
>>
>>
>>
>> How can I have this representation work for SQLFORM.grid? Thanks.
>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/1bO8XUIo0eU/unsubscribe.
> To unsubscribe from this group and all its topics, 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: DAL executesql and escaping apostrophe/single quote

2017-03-21 Thread Anthony

>
> I have other, pre-existing tables I need to query data from, so using the 
> db.table1 syntax won't work without re-creating them entirely (I think).
>

What do you mean by "re-creating them entirely?" You certainly don't have 
to re-create the actual tables in the database. Though you would have to 
define web2py DAL models so the DAL knows how to interact with the database 
tables. You can get started with this with one of the extract_*_models.py 
files from the /web2py/scripts folder.

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: Is there any benefit from linking these 3 different ways?

2017-03-21 Thread Massimo Di Pierro
This is wrong:



The reason is that it would break if the path_info.count('/')!=2 in the 
current page.

These two produce the same net effect:




I would use args if 'lookup' GETs a persistent object that resides inDB and 
I would use vars if it GETs the result of a computation and you are passing 
imput parameters. Anyway, this is purely for aesthetic reasons. 


On Tuesday, 21 March 2017 12:57:02 UTC-5, r wrote:
>
> 
>
> result: /lookup?item=1
>
>  
>
> 
>
> result: /lookup/1
>
>  
>
> 
>
> result: /lookup?item=1
>
>
> Just wondering, is there any benefit from using one method over the 
> others? I plan on retrieving the URL args/vars on the webpage. For me the 
> 1st one seems like the simplest but no difference vs the 3rd. So why would 
> people use the 3rd over the 1st when linking? 
>

-- 
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: DAL executesql and escaping apostrophe/single quote

2017-03-21 Thread Massimo Di Pierro
rows = db(db.table1.name=="Single ' Quote").select(limitby=(0,1))

web2py exists so that you do not have to use raw SQL. it is dangerous.

On Tuesday, 21 March 2017 06:13:32 UTC-5, Travis Smith wrote:
>
> Hi guys,
>
> I can't seem to find anything anywhere because everything just says "it 
> works".
>
> I'm using the latest version of web2py and mysql (maria) as my db, and I'm 
> trying to run executesql with the following query:
>
> db.executesql("SELECT * FROM table1 WHERE name = %s LIMIT 1", ("Single' 
> Quote",), as_dict=True)
>
> If I run that without the single quote, it works as expected, returning 
> the value I have without the single quote. I also have another value with 
> the single quote for testing.
>
> However, when I run the above, I get 
>
> "You have an error in your SQL syntax; check the manual that corresponds 
> to your MySQL server version for the right syntax to use near 'Quote' limit 
> 1"
>
> Is this not supposed to escape everything for me and treat them as 
> parameters? If not, what is the alternative? I have other, pre-existing 
> tables I need to query data from, so using the db.table1 syntax won't work 
> without re-creating them entirely (I think).
>
> For reference, if I run
>
> db.executesql("SELECT * FROM table1 WHERE name = 'Single'' Quote' LIMIT 
> 1", as_dict=True)
>
> and manually escape the quote, everything works as expected.
>
> Any help would be appreciated.
>
>
> Thanks,
>
> Travis
>

-- 
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: Extracting values of a list from the database and using them individually in a javascript array

2017-03-21 Thread Massimo Di Pierro
def form1Details():
form = db.compForm(request.args(0))
forms = 
db(db.compFormPages.formName==form.id).select(db.compFormPages.ALL)
images = [{'link':URL('download',args=form.formImage), 
'title':form.formTitle} for form in forms]
return dict(images=images)

the images are in variable forms so i wanna display them in my view such 
that each picture is stored individually inside a JavaScript array for a 
slide show like below

VIEW


{{=ASSIGNJS(IMAGES=images)}}; // magic to convert python to JS object 
function slideShow() {
var images = IMAGES.map(function(i){return i.link;}); // array of links
var descriptions= IMAGES.map(function(i){return i.title;}); // array of 
titles
}



On Tuesday, 21 March 2017 05:45:36 UTC-5, Cypher wrote:
>
> Hi guys i need help, please someone out there coz I'm pulling out my hairs 
> at this point:
> I want to extract pictures from within a list extracted from the database 
> and store them inside a JavaScript array for a slide show.
>
>
> *CONTROLLER:*
>
>
>
>
> *def form1Details():form=db.compForm(request.args(0))
> forms=db(db.compFormPages.formName==form.id 
> ).select(db.compFormPages.ALL)return locals()*the 
> images are in variable forms so i wanna display them in my view such that 
> each picture is stored individually inside a JavaScript array for a slide 
> show like below
>
>
> *VIEW**{{for pic in form:}}*
>
>
>
>
>
> *function slideShow(){images = ["{{=URL('download', 
> args=pic.formImage)}}", "{{=URL('download', args=pic2.formImage)}}", 
> "{{=URL('download', args=pic3.formImage)}}"];*
>
>
>
>
>
>
>
> *descriptions=['{{=pic.formTitle}}', '{{=pic2.formTitle}}', 
> '{{=pic3.formTitle}}'];.}*How
>  
> do extract them individually to achieve the above, i could use all the help 
> i could get, 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: edit or delete child or detail table on SQLFORM.grid with left join

2017-03-21 Thread Massimo Di Pierro
For example:


db.define_table('thing',Field('name'),Field('checked','boolean',readable=False))

def index():
   grid = SQLFORM.grid(db.thing, links=[lambda row: 
A('check',_onclick="jQuery.post('%s')" % URL('check',args=row.id))])
   return dict(grid=grid)

def check():
  db(db.thing.id==request.args(0)).update(checked=True)




On Monday, 20 March 2017 18:38:52 UTC-5, 黄祥 wrote:
>
> could anyone give an example to custom button in grid that does an ajax 
> query?
>
> another question is oot :
> what is the best practice to define table for transaction that separated 
> for header and detail? 
> when use header and detail it good for normalisation but not good in 
> operational, in case want to edit or delete it, when using 1 table for 
> header and detail, the data is for header is repeated in the rows.
>
> thanks and 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] Is there any benefit from linking these 3 different ways?

2017-03-21 Thread r




result: /lookup?item=1

 



result: /lookup/1

 



result: /lookup?item=1


Just wondering, is there any benefit from using one method over the others? 
I plan on retrieving the URL args/vars on the webpage. For me the 1st one 
seems like the simplest but no difference vs the 3rd. So why would people 
use the 3rd over the 1st when linking? 

-- 
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: request.folder

2017-03-21 Thread Anthony
How does this cause problems for you?

Note, because starting the shell or scheduler involves calling web2py.py in 
the /web2py folder, the Python working directory will be /web2py, so 
request.folder will be relative to the /web2py folder from the perspective 
of the Python interpreter. If you need the absolute path, you can always 
use os.path.abspath(request.folder).

That having been said, I'm not sure why exec_environment and env in 
gluon.shell do not set request.folder to the absolute path based on 
gluon.settings.global_settings.gluon_parent (which itself comes from the 
Python working directory unless there is a "web2py_path" environment 
variable).

Anthony

On Tuesday, March 21, 2017 at 5:45:12 AM UTC-4, Oliver Holmes wrote:
>
> Yes, this behavior just annoyed the hell out of me too. When referenced in 
> the application itself request.folder behaves as documented here: 
> http://web2py.com/books/default/chapter/29/04/the-core#request ( (i.e. 
> full absolute path). But as soon as it is used in a module called as 
> scheduled task (parameter -K) or as a background task as noted here in this 
> thread it will give only the relative path to the app starting with 
> "application" i.e. "application/MyApp". I consider this to be a bug and 
> would very much appreciate a fix.
>
> Sincerely,
> Oliver Holmes
>
>
>
> Am Mittwoch, 4. Dezember 2013 11:39:57 UTC+1 schrieb Marin Pranjić:
>>
>> With trunk (and 2.8.2) I don't get absolute path.
>>
>> request.folder is "applications/appname"
>> Shouldn't it be absolute instead of relative?
>>
>>
>> Marin
>>
>

-- 
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] scheduler error: column "worker_stats__tmp" is of type json

2017-03-21 Thread António Ramos
any ideas ?

2017-03-20 12:54 GMT+00:00 António Ramos :

> any help? I´m hosting with webfaction and they moved my app to another
> server
>  column "worker_stats__tmp" is of type
> json but expression is of type text LINE 1: UPDATE scheduler_worker SET
> worker_stats__tmp=worker_stats; ^ HINT: You will need to rewrite or cast
> the expression.Versão
> web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
> Python Python 2.7.5: /home/ramstein74/webapps/new2py/bin/uwsgi (prefix:
> /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
>
> Traceback (most recent call last):
>   File "/home/ramstein74/webapps/new2py/web2py/gluon/restricted.py", line 
> 227, in restricted
> exec ccode in environment
>   File 
> "/home/ramstein74/webapps/new2py/web2py/applications/fileit/models/db1.py" 
> , line 127, in 
> 
> scheduler=Scheduler(db)
>   File "/home/ramstein74/webapps/new2py/web2py/gluon/scheduler.py", line 567, 
> in __init__
> self.define_tables(db, migrate=migrate)
>   File "/home/ramstein74/webapps/new2py/web2py/gluon/scheduler.py", line 659, 
> in define_tables
> migrate=self.__get_migrate('scheduler_worker', migrate)
>   File 
> "/home/ramstein74/webapps/new2py/web2py/gluon/packages/dal/pydal/base.py", 
> line 834, in define_table
> table = self.lazy_define_table(tablename,*fields,**args)
>   File 
> "/home/ramstein74/webapps/new2py/web2py/gluon/packages/dal/pydal/base.py", 
> line 873, in lazy_define_table
> polymodel=polymodel)
>   File 
> "/home/ramstein74/webapps/new2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 510, in create_table
> fake_migrate=fake_migrate
>   File 
> "/home/ramstein74/webapps/new2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 623, in migrate_table
> self.execute(sub_query)
>   File 
> "/home/ramstein74/webapps/new2py/web2py/gluon/packages/dal/pydal/adapters/postgres.py",
>  line 362, in execute
> return BaseAdapter.execute(self, *a, **b)
>   File 
> "/home/ramstein74/webapps/new2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 1388, in execute
> return self.log_execute(*a, **b)
>   File 
> "/home/ramstein74/webapps/new2py/web2py/gluon/packages/dal/pydal/adapters/base.py",
>  line 1382, in log_execute
> ret = self.get_cursor().execute(command, *a[1:], **b)
> ProgrammingError: column "worker_stats__tmp" is of type json but expression 
> is of type text
> LINE 1: UPDATE scheduler_worker SET worker_stats__tmp=worker_stats;
>   ^
> HINT:  You will need to rewrite or cast the expression.
>
>
>
>
>
>

-- 
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: Regarding "registration needs verification"

2017-03-21 Thread bk Coc
auth.settings.login_after_registration = False


or remove it

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


[web2py] DAL executesql and escaping apostrophe/single quote

2017-03-21 Thread Travis Smith
Hi guys,

I can't seem to find anything anywhere because everything just says "it 
works".

I'm using the latest version of web2py and mysql (maria) as my db, and I'm 
trying to run executesql with the following query:

db.executesql("SELECT * FROM table1 WHERE name = %s LIMIT 1", ("Single' 
Quote",), as_dict=True)

If I run that without the single quote, it works as expected, returning the 
value I have without the single quote. I also have another value with the 
single quote for testing.

However, when I run the above, I get 

"You have an error in your SQL syntax; check the manual that corresponds to 
your MySQL server version for the right syntax to use near 'Quote' limit 1"

Is this not supposed to escape everything for me and treat them as 
parameters? If not, what is the alternative? I have other, pre-existing 
tables I need to query data from, so using the db.table1 syntax won't work 
without re-creating them entirely (I think).

For reference, if I run

db.executesql("SELECT * FROM table1 WHERE name = 'Single'' Quote' LIMIT 1", 
as_dict=True)

and manually escape the quote, everything works as expected.

Any help would be appreciated.


Thanks,

Travis

-- 
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] Extracting values of a list from the database and using them individually in a javascript array

2017-03-21 Thread Cypher
Hi guys i need help, please someone out there coz I'm pulling out my hairs 
at this point:
I want to extract pictures from within a list extracted from the database 
and store them inside a JavaScript array for a slide show.


*CONTROLLER:*




*def form1Details():form=db.compForm(request.args(0))
forms=db(db.compFormPages.formName==form.id).select(db.compFormPages.ALL)
return locals()*the images are in variable forms so i wanna display them in 
my view such that each picture is stored individually inside a JavaScript 
array for a slide show like below


*VIEW**{{for pic in form:}}*





*function slideShow(){images = ["{{=URL('download', 
args=pic.formImage)}}", "{{=URL('download', args=pic2.formImage)}}", 
"{{=URL('download', args=pic3.formImage)}}"];*







*descriptions=['{{=pic.formTitle}}', '{{=pic2.formTitle}}', 
'{{=pic3.formTitle}}'];.}*How
 
do extract them individually to achieve the above, i could use all the help 
i could get, 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: request.folder

2017-03-21 Thread Oliver Holmes
Yes, this behavior just annoyed the hell out of me too. When referenced in 
the application itself request.folder behaves as documented her: 
http://web2py.com/books/default/chapter/29/04/the-core#request ( (i.e. full 
absolute path). But as soon as it is used in a module called as scheduled 
task (parameter -K) or as a background task as noted here in this thread it 
will give only the relative path to the app starting with "application" 
i.e. "application/MyApp". I consider this to be a bug and would very much 
appreciate a fix.

Sincerly,
Oliver Holmes



Am Mittwoch, 4. Dezember 2013 11:39:57 UTC+1 schrieb Marin Pranjić:
>
> With trunk (and 2.8.2) I don't get absolute path.
>
> request.folder is "applications/appname"
> Shouldn't it be absolute instead of relative?
>
>
> Marin
>

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