Re: [web2py] Re: the ajax callback action return a list [URGENT]

2017-06-01 Thread Junior Phanter

var list_sunda = "";
ajax("your_echo_url", [], ':eval');


def echo_url():
list_sunda=[1,2,3,4,5]
return "list_sunda=%s;" %list_sunda

2017-06-01 3:49 GMT-03:00 :

> Hey paco,
>
> the problem is that i am using script, so the the action in the controller
> is a callback, it means that it dont have his html page.
>
> --
> 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: the ajax callback action return a list [URGENT]

2017-06-01 Thread Paco Bernal
But what are you returning in the controller??


El jueves, 1 de junio de 2017, 8:49:46 (UTC+2), sunda...@gmail.com escribió:
>
> Hey paco,
>
> the problem is that i am using script, so the the action in the controller 
> is a callback, it means that it dont have his html page.
>
>

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


[web2py] How to speed up query processing in web2py's sqlite?

2017-06-01 Thread Mike Stephenson
I see that with a million of rows, the search takes almost 15-20 seconds. 
How do I speed it up?

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


[web2py] Re: grid add/edit form label

2017-06-01 Thread T.R.Rajkumar
For a smartgrid I am doing this.
form = SQLFORM.smartgrid(db.amc_master,
 linked_tables=['amc_details'],
 user_signature=False,
 fields=dict(amc_master=list_of_fields),
 formstyle='table3cols',
 headers=headers,
 
editargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'},
 
amc_details={'qty':'Quantity'})},
 
createargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'},
 
amc_details={'qty':'Quantity'})})

But I see no effect in labels of edit/create forms. I dont know how to do 
that. Pl. help.

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


[web2py] Any ideas on how to prepare web2py apps for GDPR

2017-06-01 Thread António Ramos
I have 3 apps where i need to address this issue...


http://www.computerweekly.com/news/450419960/Top-UK-firms-websites-violate-key-GDPR-principle?utm_medium=EM&asrc=EM_EDA_77932701&utm_campaign=20170601_Top%20UK%20firms%E2%80%99%20websites%20violate%20key%20GDPR%20principle&utm_source=EDA

Regards
António


Sem
vírus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-- 
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: the ajax callback action return a list [URGENT]

2017-06-01 Thread sunda . amran
I totally agree with that but then how do you use that list in  the view as 
a python variable ???

Le jeudi 1 juin 2017 09:09:15 UTC+2, Junior Phanter a écrit :
>
> 
> var list_sunda = "";
> ajax("your_echo_url", [], ':eval');
> 
>
> def echo_url():
> list_sunda=[1,2,3,4,5]
> return "list_sunda=%s;" %list_sunda
>
> 2017-06-01 3:49 GMT-03:00 >:
>
>> Hey paco,
>>
>> the problem is that i am using script, so the the action in the 
>> controller is a callback, it means that it dont have his html page.
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: [web2py] Re: the ajax callback action return a list [URGENT]

2017-06-01 Thread Paco Bernal

In server side when rendering the view you use python vars with 
{{=my_python_var}}
If you are asking how to use a python var in client side with javascript 
you can use ASSIGNJS(js_var=python_var)

Take a look at the files I uploaded before.

def mycontroller():
.
return ASSIGNJS(js_var=python_list)

if you use ':eval' you will have a new js_var var to use with javascript.
if you use a view to fill a div you can do the same thing, but then you 
will return dict(whatever=whatever) and in the view you can use 
{{=ASSIGN(js_var=whatever)}} inside a script tag.

El jueves, 1 de junio de 2017, 15:44:06 (UTC+2), sunda...@gmail.com 
escribió:
>
> I totally agree with that but then how do you use that list in  the view 
> as a python variable ???
>
> Le jeudi 1 juin 2017 09:09:15 UTC+2, Junior Phanter a écrit :
>>
>> 
>> var list_sunda = "";
>> ajax("your_echo_url", [], ':eval');
>> 
>>
>> def echo_url():
>> list_sunda=[1,2,3,4,5]
>> return "list_sunda=%s;" %list_sunda
>>
>> 2017-06-01 3:49 GMT-03:00 :
>>
>>> Hey paco,
>>>
>>> the problem is that i am using script, so the the action in the 
>>> controller is a callback, it means that it dont have his html page.
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

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


[web2py] Re: grid add/edit form label

2017-06-01 Thread Jim S
Set the 'label' attribute on the individual fields that will be displayed 
before your call to SQLFORM.smartgrid()

Ex:  db.customer.first_name.label = 'First Name'

-Jim

On Thursday, June 1, 2017 at 4:35:14 AM UTC-5, T.R.Rajkumar wrote:
>
> For a smartgrid I am doing this.
> form = SQLFORM.smartgrid(db.amc_master,
>  linked_tables=['amc_details'],
>  user_signature=False,
>  fields=dict(amc_master=list_of_fields),
>  formstyle='table3cols',
>  headers=headers,
>  
> editargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'},
>  
> amc_details={'qty':'Quantity'})},
>  
> createargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'},
>  
> amc_details={'qty':'Quantity'})})
>
> But I see no effect in labels of edit/create forms. I dont know how to do 
> that. Pl. help.
>

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


Re: [web2py] Migration fails when dropping a column on Postgresql

2017-06-01 Thread Richard Vézina
Thanks Doug,

I was understanding that, it much clearer now though. Your use case for
rname seems exactly what rname is for.

Good luck

Richard

On Wed, May 31, 2017 at 6:15 PM, Doug Taylor  wrote:

> Hi Richard -
>
> Thanks for response. I am running web2py version:
> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>
> I'm using rname because postgresql doesn't like case sensitive table and
> field names much, and neither do my colleagues, but I like CamelCase in my
> code, so as you say, for code readability. Reproducing the problem is very
> easy. All I did was comment out the 'OS' (rname 'file_server_os') field
> from my model as below and set migrate to True. The define table statement
> failed immediately because the SQL was using the Table and Field names,
> rather than the rnames (lower_case_with_underscores) in the ALTER TABLE
> statement.
>
> db.define_table('FileServer',
> Field('HostName', rname='host_name', type='string', length=32,
> label='Host', comment='The Host Name of the Server on the network'),
> Field('Address', rname='file_server_address', type='string',
> length=32, label='Address', comment='The Address of the Server'),
> Field('CommissioningDate', rname='file_server_comm_date',
> type='date', label='Commissioning Date', comment='The date on which the
> Server was commissioned (-MM-DD)'),
> #Field('OS', rname='file_server_os', type='string',
> length=32, label='OS', comment='The Operating System running on the
> Server'),
> audit,
> rname='file_server',
> format='%(HostName)s',
> singular='Server',
> plural='Servers',
> migrate=True)
>
> I will post to the pydal repo as Anthony suggests.
>
> On Wednesday, May 31, 2017 at 7:03:38 PM UTC+2, Richard wrote:
>>
>> Hi Doug,
>>
>> I am not sure I follow and understand the exact problem, it maybe me, but
>> can you provide model before and after and.
>>
>> You may also try to reproduce the bug and explain the exact step to
>> trigger it and pack an dummy app to facilitate the reproducing of the bug
>> for us.
>>
>> Also, specify the version of web2py, trunk or latest official release??
>>
>> Notice that rname is relatively recent feature, and I am not sure that it
>> is wildly use, so it may suffer from some flaw. To my knowledge it mostly
>> intent to be used with legacy database schema that can be alter so you can
>> specify different field/table name in the database and the model to improve
>> code readability for instance or other specific purposes that would require
>> having a different set of field name in the database and in the front
>> end... I hardly see the purpose to use it in a new projet as you already
>> have field name and label to set proper end-user field name and database
>> compliant field name.
>>
>> Thanks
>>
>> Richard
>>
>>
>>
>> On Wed, May 31, 2017 at 10:58 AM, Doug Taylor 
>> wrote:
>>
>>> Hi I'm a relative noob to web2py and python - but plenty of dev
>>> experience. Must say it has been a smooth learning curve for me and most
>>> stuff just works out the box... thanks Massimo!
>>>
>>> Pretty sure I found a bug here though. Running on ubuntu Xenial,
>>> postgresql 9.6 with psycopg2. I have a table defined thus:
>>>
>>> db.define_table('FileServer',
>>> Field('HostName', rname='host_name', type='string',
>>> length=32, label='Host', comment='The Host Name of the Server on the
>>> network'),
>>> Field('Address', rname='file_server_address', type='string',
>>> length=32, label='Address', comment='The Address of the Server'),
>>> Field('CommissioningDate', rname='file_server_comm_date',
>>> type='date', label='Commissioning Date', comment='The date on which the
>>> Server was commissioned (-MM-DD)'),
>>> Field('OS', rname='file_server_os', type='string',
>>> length=32, label='OS', comment='The Operating System running on the
>>> Server'),
>>> audit,
>>> rname='file_server',
>>> format='%(HostName)s',
>>> singular='Server',
>>> plural='Servers',
>>> migrate=True)
>>>
>>> Decided to drop the OS column and create a new relation for it instead.
>>> The migration fails with "relation fileserver does not exist". Went to look
>>> in my sql.log file and found these entries:
>>>
>>> from run previous when table is created
>>>
>>> timestamp: 2017-05-30T13:10:09.134114
>>> CREATE TABLE file_server(
>>> id SERIAL PRIMARY KEY,
>>> host_name VARCHAR(32),
>>> file_server_address VARCHAR(32),
>>> file_server_comm_date DATE,
>>> file_server_os VARCHAR(32),
>>> created_on TIMESTAMP,
>>> created_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE  ,
>>> updated_on TIMESTAMP,
>>> updated_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE  ,
>>> is_validated CHAR(1),
>>> is_active CHAR(1)
>>> );
>>> success!
>>>
>>>
>>> when I kick off th

[web2py] Re: postgres 8, psycopg2, text datatype limit of 32k.

2017-06-01 Thread Leonel Câmara
Yes, that's the default value for length of text type fields see here:

https://github.com/web2py/pydal/blob/master/pydal/objects.py#L40

The value is set to 2**15 which is 32768

Then you don't have a requires so web2py puts one for you in
https://github.com/web2py/web2py/blob/master/gluon/dal.py#L29

So you text field has a requires IS_LENGTH(32768)

Note that by default, the value of a Field requires is not None, it is 
DEFAULT.

Anyway, the simple solution is to put your text field requires=None, 
requires=IS_NOT_EMPTY() or requires=IS_LENGTH(1073741824)  # 1GB

-- 
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 speed up query processing in web2py's sqlite?

2017-06-01 Thread Leonel Câmara
Creating an index on the field you're searching will help. You should 
probably also cache the results of the queries if at all possible.

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


[web2py] Re: grid add/edit form label

2017-06-01 Thread Anthony
On Thursday, June 1, 2017 at 5:35:14 AM UTC-4, T.R.Rajkumar wrote:
>
> For a smartgrid I am doing this.
> form = SQLFORM.smartgrid(db.amc_master,
>  linked_tables=['amc_details'],
>  user_signature=False,
>  fields=dict(amc_master=list_of_fields),
>  formstyle='table3cols',
>  headers=headers,
>  
> editargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'},
>  
> amc_details={'qty':'Quantity'})},
>  
> createargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'},
>  
> amc_details={'qty':'Quantity'})})
>

You've got it backwards -- the top-level keys of the editargs and 
createargs parameters should be the table names, with the nested 
dictionaries holding the actual SQLFORM arguments.

Also, if you are using the same labels for create and edit forms, you can 
instead just use "formargs", which will apply to all forms.

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: Any ideas on how to prepare web2py apps for GDPR

2017-06-01 Thread Anthony
What specific functionality do you think web2py could offer at the 
framework level?

On Thursday, June 1, 2017 at 6:40:15 AM UTC-4, Ramos wrote:
>
> I have 3 apps where i need to address this issue...
>
>
>
> http://www.computerweekly.com/news/450419960/Top-UK-firms-websites-violate-key-GDPR-principle?utm_medium=EM&asrc=EM_EDA_77932701&utm_campaign=20170601_Top%20UK%20firms%E2%80%99%20websites%20violate%20key%20GDPR%20principle&utm_source=EDA
>
> Regards
> António
>
>
> 
>  Sem 
> vírus. www.avast.com 
> 
>  
> <#CAEM0BxOt_yRJdomZkuFp9+x-r1QLR7cUmVB+t2ZjDDf6QpMt8w@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>

-- 
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: Any ideas on how to prepare web2py apps for GDPR

2017-06-01 Thread António Ramos
One of the requisites is encryption on all user specific data

2017-06-01 18:01 GMT+01:00 Anthony :

> What specific functionality do you think web2py could offer at the
> framework level?
>
>
> On Thursday, June 1, 2017 at 6:40:15 AM UTC-4, Ramos wrote:
>>
>> I have 3 apps where i need to address this issue...
>>
>>
>> http://www.computerweekly.com/news/450419960/Top-UK-firms-we
>> bsites-violate-key-GDPR-principle?utm_medium=EM&asrc=EM_EDA_
>> 77932701&utm_campaign=20170601_Top%20UK%20firms%E2%80%99%
>> 20websites%20violate%20key%20GDPR%20principle&utm_source=EDA
>>
>> Regards
>> António
>>
>>
>> 
>>  Sem
>> vírus. www.avast.com
>> 
>> <#m_-7949242699042973214_CAEM0BxOt_yRJdomZkuFp9+x-r1QLR7cUmVB+t2ZjDDf6QpMt8w@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
> --
> 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 change form vars

2017-06-01 Thread Anthony
On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote:
>
> Antony
> could you elaborate or give an example of how to use formargs,editargs 
> etc. ?
>

When viewing/creating/updating individual records, the grid creates a 
SQLFORM. You can use formargs, etc. to pass arguments directly to the 
SQLFORM instance generated by the grid -- just put the relevant arguments 
in a dictionary.
 

> You write that it can be used by passing it to SQLFORM but what could be 
> the actual use of it?
> In another post 
>
> https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J
>
> Niphlod get a bit closer to a use example by specifying  editargs to 
> reorder fields on an edit form. For the first it works  on grid but not on 
> smartgrid, why ?
>

The smartgrid can display forms for multiple tables, so many of its 
arguments should actually be dictionaries with individual table names as 
the keys, and then the arguments for each table as the values. So, for 
smartgrid, you would have something like:

SQLFORM.smartgrid(..., formargs={'table1': dict(...), 'table2': dict(...), 
...})

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: Any ideas on how to prepare web2py apps for GDPR

2017-06-01 Thread Dave S


On Thursday, June 1, 2017 at 10:06:20 AM UTC-7, Ramos wrote:
>
> One of the requisites is encryption on all user specific data
>

Isn't that better handled by the database engine?

/dps
 

>
> 2017-06-01 18:01 GMT+01:00 Anthony >:
>
>> What specific functionality do you think web2py could offer at the 
>> framework level?
>>
>>
>> On Thursday, June 1, 2017 at 6:40:15 AM UTC-4, Ramos wrote:
>>>
>>> I have 3 apps where i need to address this issue...
>>>
>>>
>>>
>>> http://www.computerweekly.com/news/450419960/Top-UK-firms-websites-violate-key-GDPR-principle?utm_medium=EM&asrc=EM_EDA_77932701&utm_campaign=20170601_Top%20UK%20firms%E2%80%99%20websites%20violate%20key%20GDPR%20principle&utm_source=EDA
>>>
>>> Regards
>>> António
>>>
>>>
>>> 
>>>  Sem 
>>> vírus. www.avast.com 
>>> 
>>>  
>>> <#CAEM0BxP=OT4uVBOrqOnwO6LYFBi=KC7r0tvR5Ad=yapdKmASbg@mail.gmail.com_m_-7949242699042973214_CAEM0BxOt_yRJdomZkuFp9+x-r1QLR7cUmVB+t2ZjDDf6QpMt8w@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


[web2py] Re: SQLFORM.grid change form vars

2017-06-01 Thread icodk
Thanks, That explain why it didn't work in smartgrid (because I haven't 
specify the table name)
I still do not understand how my arguments will effect the auto generated 
SQLFORM or what kind of argument will effect the form and in what way.
Is Niphlod's example is the only thing  you can do with it (reorder fields)?
Thanks

On Thursday, June 1, 2017 at 7:06:13 PM UTC+2, Anthony wrote:
>
> On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote:
>>
>> Antony
>> could you elaborate or give an example of how to use formargs,editargs 
>> etc. ?
>>
>
> When viewing/creating/updating individual records, the grid creates a 
> SQLFORM. You can use formargs, etc. to pass arguments directly to the 
> SQLFORM instance generated by the grid -- just put the relevant arguments 
> in a dictionary.
>  
>
>> You write that it can be used by passing it to SQLFORM but what could be 
>> the actual use of it?
>> In another post 
>>
>> https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J
>>
>> Niphlod get a bit closer to a use example by specifying  editargs to 
>> reorder fields on an edit form. For the first it works  on grid but not on 
>> smartgrid, why ?
>>
>
> The smartgrid can display forms for multiple tables, so many of its 
> arguments should actually be dictionaries with individual table names as 
> the keys, and then the arguments for each table as the values. So, for 
> smartgrid, you would have something like:
>
> SQLFORM.smartgrid(..., formargs={'table1': dict(...), 'table2': dict(...), 
> ...})
>
> 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: SQLFORM.grid change form vars

2017-06-01 Thread Dave S


On Thursday, June 1, 2017 at 2:52:08 PM UTC-7, icodk wrote:
>
> Thanks, That explain why it didn't work in smartgrid (because I haven't 
> specify the table name)
> I still do not understand how my arguments will effect the auto generated 
> SQLFORM or what kind of argument will effect the form and in what way.
> Is Niphlod's example is the only thing  you can do with it (reorder 
> fields)?
> Thanks
>

Perhaps you could add a link to Niphlod's post, so that we can see what 
context he was addressing.

/dps
 

>
> On Thursday, June 1, 2017 at 7:06:13 PM UTC+2, Anthony wrote:
>>
>> On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote:
>>>
>>> Antony
>>> could you elaborate or give an example of how to use formargs,editargs 
>>> etc. ?
>>>
>>
>> When viewing/creating/updating individual records, the grid creates a 
>> SQLFORM. You can use formargs, etc. to pass arguments directly to the 
>> SQLFORM instance generated by the grid -- just put the relevant arguments 
>> in a dictionary.
>>  
>>
>>> You write that it can be used by passing it to SQLFORM but what could be 
>>> the actual use of it?
>>> In another post 
>>>
>>> https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J
>>>
>>> Niphlod get a bit closer to a use example by specifying  editargs to 
>>> reorder fields on an edit form. For the first it works  on grid but not on 
>>> smartgrid, why ?
>>>
>>
>> The smartgrid can display forms for multiple tables, so many of its 
>> arguments should actually be dictionaries with individual table names as 
>> the keys, and then the arguments for each table as the values. So, for 
>> smartgrid, you would have something like:
>>
>> SQLFORM.smartgrid(..., formargs={'table1': dict(...), 'table2': dict
>> (...), ...})
>>
>> 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: SQLFORM.grid change form vars

2017-06-01 Thread Anthony
On Thursday, June 1, 2017 at 5:52:08 PM UTC-4, icodk wrote:
>
> Thanks, That explain why it didn't work in smartgrid (because I haven't 
> specify the table name)
> I still do not understand how my arguments will effect the auto generated 
> SQLFORM or what kind of argument will effect the form and in what way.
>

You can pass any arguments that you would normally pass to SQLFORM(), so 
they will have whatever effect they would normally have.

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: Any ideas on how to prepare web2py apps for GDPR

2017-06-01 Thread Anthony
On Thursday, June 1, 2017 at 1:06:20 PM UTC-4, Ramos wrote:
>
> One of the requisites is encryption on all user specific data
>

Do you have a link to any detailed specifications? Is encrypting the server 
storage adequate? I suspect these are not necessarily going to be in scope 
for a web framework.

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] strange error: Field update_record does not belong to the table

2017-06-01 Thread Jochen Naumann
Hi, I am an experienced web programmer but new to web2py, so I hope to find 
some help here :-)
I have an application running perfectly on my local server (macbook air, 
web2py 2.14) but the same application on a linux web server (web2py 2.9) 
throws this strange exception inside web2pys function forms.process. Does 
anybody have a clue? Could it be the older version?


 Field update_record does not belong to the 
tableVersion
web2py™ Version 2.9.12-stable+timestamp.2015.01.17.06.11.03
Python Python 2.7.13: /usr/sbin/python2.7 (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.

Traceback (most recent call last):
  File "/usr/local/webapps/web2py/gluon/restricted.py", line 224, in restricted
exec ccode in environment
  File 
"/usr/local/webapps/web2py/applications/anmeldung/controllers/veranstaltung.py" 
,
 line 439, in 
  File "/usr/local/webapps/web2py/gluon/globals.py", line 393, in 
self._caller = lambda f: f()
  File "/usr/local/webapps/web2py/gluon/tools.py", line 3444, in f
return action(*a, **b)
  File 
"/usr/local/webapps/web2py/applications/anmeldung/controllers/veranstaltung.py" 
,
 line 42, in aendern
return anmeldung_dateneingabe(True)
  File 
"/usr/local/webapps/web2py/applications/anmeldung/controllers/veranstaltung.py" 
,
 line 75, in anmeldung_dateneingabe
if form.process().accepted:
  File "/usr/local/webapps/web2py/gluon/html.py", line 2303, in process
self.validate(**kwargs)
  File "/usr/local/webapps/web2py/gluon/html.py", line 2240, in validate
if self.accepts(**kwargs):
  File "/usr/local/webapps/web2py/gluon/sqlhtml.py", line 1677, in accepts
self.vars.id = self.table.insert(**fields)
  File "/usr/local/webapps/web2py/gluon/dal/objects.py", line 724, in insert
ret =  self._db._adapter.insert(self, self._listify(fields))
  File "/usr/local/webapps/web2py/gluon/dal/objects.py", line 644, in _listify
'Field %s does not belong to the table' % name)SyntaxError: Field 
update_record does not belong to the table



-- 
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] Login(auth) from Oracle db

2017-06-01 Thread Вячеслав Анатольевич
Hi!
Can anybody help me? I am only starting on web2py.
So, i have db oracle with alredy having data, and i want to make login 
only, without reg/change pass and other.
I have a table in db for example, user_psw, where i have "name" and "pwd" - 
(username & password).
How i can tell web2py watch username and password in that table in that 
colums. If you can, small example please.
Sory fo my english.

-- 
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] 'validate_and_insert' throws error each time on latest version where it was fine before on prev version

2017-06-01 Thread Jordan Ladora
Hello,

I just belatedly upgraded from 8/9/15 (v2.12.2-stable) -> 5/10/16
(v2.14.6-stable)
and have about 100 instances of 'validate_and_insert' in my application.

My app was previously (with 8/9/15 version) running these instances of
'validate_and_insert' A-OK but now, basically every instance of
'validate_and_insert' is throwing an error. When I use the shell I get a
traceback that ends in:

if isinstance(value, (int, long)) or value.isdigit():
AttributeError: 'NoneType' object has no attribute 'isdigit'

It does this every single time I try to run 'validate_and_insert' when
otherwise everything seems fine (and when I go back to the previous version
and run the same exact code in the shell it goes fine).

If I change the 'validate_and_insert' to just 'insert' it works, but I'd
like to keep the code the way it was before.. anyone else stumble on this
or have a suggestion?

fyi it seems a little similar to the 5/8/17 thread "Validate_and_insert
fails because "id" has no value" where he is also using 2.14.6-stable.

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: postgres 8, psycopg2, text datatype limit of 32k.

2017-06-01 Thread lucas
yes, thank you, it all connects now.  1073741824 = 2**30 = 1GB.  thank you 
again, lucas

-- 
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 change form vars

2017-06-01 Thread Dave S


On Thursday, June 1, 2017 at 6:19:02 PM UTC-7, Dave S wrote:
>
>
>
> On Thursday, June 1, 2017 at 2:52:08 PM UTC-7, icodk wrote:
>>
>> Thanks, That explain why it didn't work in smartgrid (because I haven't 
>> specify the table name)
>> I still do not understand how my arguments will effect the auto generated 
>> SQLFORM or what kind of argument will effect the form and in what way.
>> Is Niphlod's example is the only thing  you can do with it (reorder 
>> fields)?
>> Thanks
>>
>
> Perhaps you could add a link to Niphlod's post, so that we can see what 
> context he was addressing.
>


Whoops, sorry!  You already did this, and I just plain missed it.[...]
On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote:
[...]
>
> In another post 
> 
>  
>
https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J
>
> Niphlod get a bit closer to a use example by specifying  editargs to 
> reorder fields on an edit form. For the first it works  on grid but not on 
> smartgrid, why ?
>

 

>

-- 
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: Login(auth) from Oracle db

2017-06-01 Thread Dave S


On Thursday, June 1, 2017 at 7:44:48 PM UTC-7, Вячеслав Анатольевич wrote:
>
> Hi!
> Can anybody help me? I am only starting on web2py.
> So, i have db oracle with alredy having data, and i want to make login 
> only, without reg/change pass and other.
> I have a table in db for example, user_psw, where i have "name" and "pwd" 
> - (username & password).
> How i can tell web2py watch username and password in that table in that 
> colums. If you can, small example please.
> Sory fo my english.
>

I would recommend reviewing Chapter 9 of the book.  The part most specific 
to your question would seem to be
http://web2py.com/books/default/chapter/29/09/access-control#Other-login-methods-and-login-forms>
but I'd read the general description (and maybe look back to Chapter 4's 
workflow section).

A simple example of using the out-of-the-box web2py auth is shown in 
Chapter 3 for the image blog instantiation.

/dps
 

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


[web2py] Re: grid add/edit form label

2017-06-01 Thread T.R.Rajkumar
You've got it backwards -- the top-level keys of the editargs and 
createargs parameters should be the table names, with the nested 
dictionaries holding the actual SQLFORM arguments.

I am not familiar with the syntax. Can you pl. elaborate with some actual 
code. Thanks 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: SQLFORM.grid change form vars

2017-06-01 Thread icodk
Dave S.
I appreciate  your responsiveness and alertness and the ever willingness to 
help others.
Thanks

On Friday, June 2, 2017 at 6:37:03 AM UTC+2, Dave S wrote:
>
>
>
> On Thursday, June 1, 2017 at 6:19:02 PM UTC-7, Dave S wrote:
>>
>>
>>
>> On Thursday, June 1, 2017 at 2:52:08 PM UTC-7, icodk wrote:
>>>
>>> Thanks, That explain why it didn't work in smartgrid (because I haven't 
>>> specify the table name)
>>> I still do not understand how my arguments will effect the auto 
>>> generated SQLFORM or what kind of argument will effect the form and in what 
>>> way.
>>> Is Niphlod's example is the only thing  you can do with it (reorder 
>>> fields)?
>>> Thanks
>>>
>>
>> Perhaps you could add a link to Niphlod's post, so that we can see what 
>> context he was addressing.
>>
>
>
> Whoops, sorry!  You already did this, and I just plain missed it.[...]
> On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote:
> [...]
>>
>> In another post 
>> 
>>  
>>
>
>> https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J
>>
>> Niphlod get a bit closer to a use example by specifying  editargs to 
>> reorder fields on an edit form. For the first it works  on grid but not on 
>> smartgrid, why ?
>>
>
>  
>
>>

-- 
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 change form vars

2017-06-01 Thread icodk
Thanks
I am a bit slow but I think I got it.


On Friday, June 2, 2017 at 4:41:39 AM UTC+2, Anthony wrote:
>
> On Thursday, June 1, 2017 at 5:52:08 PM UTC-4, icodk wrote:
>>
>> Thanks, That explain why it didn't work in smartgrid (because I haven't 
>> specify the table name)
>> I still do not understand how my arguments will effect the auto generated 
>> SQLFORM or what kind of argument will effect the form and in what way.
>>
>
> You can pass any arguments that you would normally pass to SQLFORM(), so 
> they will have whatever effect they would normally have.
>
> 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.