[web2py] Re: grid add/edit form label

2017-06-02 Thread T.R.Rajkumar
As said I did this in controller but there is no effect in either create or 
edit forms of amc_master or amc_details. I added the closing parenthesis 
for the first dict. Anything I miss?

form = SQLFORM.smartgrid(db.amc_master,
 linked_tables=['amc_details'],
 user_signature=False,
 fields=dict(amc_master=list_of_fields),
 formstyle='table3cols',
 headers=headers,
 formargs={'amc_master': 
dict(labels=[{'lrrflg': 'Rate Revision'}]),
   'amc_details': dict(labels=[{'qty': 
'Quantity'}])}
)

-- 
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: redirect an upload

2017-06-02 Thread Dave S


On Friday, June 2, 2017 at 4:34:56 PM UTC-7, Dave S wrote:
>
>
>
> On Tuesday, May 30, 2017 at 11:15:46 PM UTC-7, Dave S wrote:
>>
>>
>>
>> On Tuesday, May 30, 2017 at 2:59:58 PM UTC-7, Marlysson Silva wrote:
>>>
>>> The request.requires_https() is written on top of models file once time..
>>>
>>> And to respect of redirect .. Could you use the absolute URL .. Create 
>>> completly 
>>>
>>> The doc of URL() have this..
>>>
>>
>> I went back to the model file with mixed results.  The first try, I had a 
>> typo that meant things were broken but I wasn't seeing the tickets right 
>> away.
>>
>> The mixed results: 
>>
>> A linux client, using libcurl, is reporting what seems to be a correct 
>> redirect now.  I still need to tell libcurl what to do with that. (Per 
>> libcurl recommendations, I'll use the rx'd URL as the new destination and 
>> retry the send; the option to automatically follow isn't recommended.)
>>
>
> Redir works for a browser (to an actual webpage, not a  
>
[I better finish this ...] 
I'm not using an api URL in the browser), and for a libcurl client to an 
api URL.

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.
 

> For browsers and libcurl clients, the POST completes, the redir is sent, 
> the client uses the new URL, and and everyone lives happily ever after.
>
> Is there a way to tell Rocket to send the redir as soon as the URL is 
> received?  This is typically in the first packet after the connection 
> opening handshakes; does Rocket ever look at URLs, or is the routing 
> extracted at a higher level?  (My first read of rocket.py didn't clue me in 
> very far.)
>
>  
>>
> Changing the clients to start on port 443 works, but I want to have the 
>> redirs work, too.
>>
>
> Again, varies by client.  wininet is picking up that the scheme is HTTPS,  
> but it doesn't seem to change ports to reflect that.
>
>

Okay, had to be explicit about the port in InternetConnect(), and also set 
the SECURE flag in the HttpOpenRequest() call.

 
/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: Encrypting/decrypting db values

2017-06-02 Thread 黄祥
is filter_in and filter_out is part of pydal?
interested in the code example but sometime i use database that used in 
web2py app in terminal
so, is it possible to decrypt the encrypted database values in terminal?

p.s.
terminal is execute pure python code, sometime ruby or php just for 
scrapping data from website, inserted it in database that used in web2py 
app and generate the report in terminal

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

2017-06-02 Thread Ron Chatterjee
apologies for ignorance on this topic but can this be a temporary fix to see 
how much benefits web2py will have prior to go with full web3py features? 


https://docs.python.org/2/library/2to3.html

-- 
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: different default application based on the host header - Python anywhere - Go daddy

2017-06-02 Thread Ron Chatterjee
You are right.  I bought domain from go daddy. My hosting is with 
pythonanywhere. Currently using routes.py I get one go daddy domain to get 
redirect to one app. For the second domain at godaddy, what set up at routes.py 
I need to be redirected to the second app at the hosting platform? 

-- 
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: redirect an upload

2017-06-02 Thread Dave S


On Tuesday, May 30, 2017 at 11:15:46 PM UTC-7, Dave S wrote:
>
>
>
> On Tuesday, May 30, 2017 at 2:59:58 PM UTC-7, Marlysson Silva wrote:
>>
>> The request.requires_https() is written on top of models file once time..
>>
>> And to respect of redirect .. Could you use the absolute URL .. Create 
>> completly 
>>
>> The doc of URL() have this..
>>
>
> I went back to the model file with mixed results.  The first try, I had a 
> typo that meant things were broken but I wasn't seeing the tickets right 
> away.
>
> The mixed results: 
>
> A linux client, using libcurl, is reporting what seems to be a correct 
> redirect now.  I still need to tell libcurl what to do with that. (Per 
> libcurl recommendations, I'll use the rx'd URL as the new destination and 
> retry the send; the option to automatically follow isn't recommended.)
>

Redir works for a browser (to an actual webpage, not a  

> 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).  For browsers and libcurl clients, the POST completes, 
the redir is sent, the client uses the new URL, and and everyone lives 
happily ever after.

Is there a way to tell Rocket to send the redir as soon as the URL is 
received?  This is typically in the first packet after the connection 
opening handshakes; does Rocket ever look at URLs, or is the routing 
extracted at a higher level?  (My first read of rocket.py didn't clue me in 
very far.)

 
>
Changing the clients to start on port 443 works, but I want to have the 
> redirs work, too.
>

Again, varies by client.  wininet is picking up that the scheme is HTTPS,  
but it doesn't seem to change ports to reflect that.

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

2017-06-02 Thread Carlos Kitu
Hi Antonio,
I don't know the UK regulations about GDPR, but I know the spanish ones, 
and in this subject both countries apply the european regulation, thus i 
think that they must be quite similar.
The spanish data protection regulations defines three levels of security 
personal data, related to a degree of sensitivity. Each level requires 
different means of protection.
As far as I remember, at the highest level you are not required to encrypt 
the data stored at the server. You are requested to encrypt the data stored 
in removable media to be transported to another place(i.e. to send data, or 
to keep backup copies off-site), this is related to backup software, not 
the application or databases. Of course you are required to cipher your 
communication with the browser, with https. Another requirement is to track 
every change of the high security level data (previous value, updated 
valued, access date, who accessed), but you can do that easily with the 
framework with oncreation functions, for example.

Personal data protection involves formal measures (like getting explicit 
consent to record the information), and technical measures. Another 
difficult issue is the IT service providers(i.e. hosting). If you use a 
hosting service, you need specific contract clauses to address the Personal 
data issue. And you can't put the data anywhere. It must be in an european 
country, or a country with an equivalent regulation level(see this link: 
https://www.theguardian.com/technology/2015/oct/06/safe-harbour-european-court-declare-invalid-data-protection)

With regard to the article:
*In the UK, the Information Commissioner has provided guidance that, in the 
case of data loss where encryption software has not been used to protect 
the data, regulatory action may be pursued.  *
I think that they are speaking about losing removable unciphered media. If 
there is a data loss in your premises, there is no risk of disclosing 
personal data, just of losing personal information, which is also punished 
by that regulation.

*The study revealed that 34% of web pages of FT30 firms that collect PII 
are doing so insecurely, 29% are not using encryption, 3.5% are using 
vulnerable encryptions algorithms, and 1.5% have expired security 
certificates.*
This may be related with the communications. If you use https I think that 
you are safe.

I suggest you to have a look at the Personal data protection regulations, 
because the news papers is an incomplete source, at best.

And if you still need to cipher the data at the server, there is a long 
post here 

 
about this subjetc, with this example:
db.define_table('contact',
 Field('user_id', db.auth_user, default=auth.user_id, readable=False, 
writable=False),
 Field('email', label='Contact email'),
 Field('phone', label='Contact phone')
)


db.contact.email.requires = [IS_EMAIL(error_message="Wrong email address")]
db.contact.phone.requires= [IS_LENGTH(maxsize=30, error_message="Bit too 
long, right?")]
db.contact.email.filter_in = lambda value : w2p_encrypt(value)
db.contact.phone.filter_in = lambda value : w2p_encrypt(value)
db.contact.email.filter_out = lambda value : w2p_decrypt(value)
db.contact.phone.filter_out = lambda value : w2p_decrypt(value)

Good look and best regards.

El jueves, 1 de junio de 2017, 12:40:15 (UTC+2), Ramos escribió:
>
> 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=EM_EDA_77932701_campaign=20170601_Top%20UK%20firms%E2%80%99%20websites%20violate%20key%20GDPR%20principle_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.


[web2py] Strange Behavoir sql.factory()

2017-06-02 Thread Santiago Cartasegna
Hello everyone I have modified an SQLFORM.Smartgrid so when i Edit a record 
I only can modify a part of the data.
I need to make some validations, so I added a myValidation to the form (and 
it renders OK). However no validation is made on the form and 
a  response.flash with the "Success!" appears after submit the form.
In the example the error is forced so the form is not submitted

Here is some code so you can see what I am doing:
Controller documento.py
# -*- coding: utf-8 -*-
@auth.requires_login()
def nuevoDocumento():
if 'edit' in request.args:
print request.args
redirect(URL('cambiarArea', 
args=(request.args[3]),vars=dict(documentoID=request.args[3])))
form=SQLFORM.smartgrid(db.t_documentos)
db.t_documentos.f_areaActual.readable=False
db.t_documentos.f_areaActual.value = obtenerArea()
return dict(form=form)

@auth.requires_login()
def cambiarArea():
print request.args
query = (db.t_documentos.id ==request.args[0])
documento = db(query).select().first()
#db.t_documentos.f_areaActual = documento[f_areaActual]
form = SQLFORM.factory(db.t_documentos.f_areaActual)
form.validate(onvalidation=validacionesExtra(form,documento))
print "Nuevo!"
if form.process().accepted:
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
#print documento.f_areaActual
return dict(message="hello from 
documento/cambiarArea.py",documento=documento,form=form)

def obtenerArea():
groups = db((db.auth_membership.user_id==auth.user.id)& 
(db.auth_membership.group_id==db.auth_group.id)).select(db.auth_group.role)
for area in groups:
if area in ["mesa", "juridico", "titulos"]:
areaUsuario = area
break
query = (db.t_areas.f_nombre == area.role)
idArea = db.t_areas.id
ape = db(query).select(idArea).first()[idArea]
return (ape)

def validacionesExtra(form,documento):
form.errors.f_areaActual = 'El area Origen y Destino deben ser 
distintas'

View cambiarArea.html
{{extend 'layout.html'}}
This is the documento/cambiarArea.html template
{{=BEAUTIFY(response._vars)}}

Here is some log that tells me that the form is getting done:

Area 
Actualjuridicomesatitulos

If you need more data, please let me know

-- 
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-02 Thread Massimo Di Pierro
OK course it is still maintained why do you ask?

On Wednesday, 31 May 2017 14:21:40 UTC-5, Oasis Agano wrote:
>
>
> But web2py is still maintained right? or we start buying flask books
> On Saturday, May 27, 2017 at 9:11:02 AM UTC+2, Andrea Fae' wrote:
>>
>> Hello guys,
>> I'd like to know if there will be future of web2py? Any information about 
>> it?
>> 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 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: Hide breadcrumbs

2017-06-02 Thread Massimo Di Pierro
The simplest way is via css:

.web2py_breadcrumbs { display: none}



On Friday, 2 June 2017 09:40:27 UTC-5, Daniela Ortiz wrote:
>
>
> Is there any way to hide breadcrumbs of smartgrid? 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 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: Strange behaviour of SQL query on accented characters

2017-06-02 Thread Massimo Di Pierro
It is a GAE problem. It captures the print in a logfile and for some reason 
it cannot save certain characters.

On Tuesday, 30 May 2017 05:07:30 UTC-5, Karoly Kantor wrote:
>
> Please help:
>
> I have this:
>
> print "DEBUG: query = " + str(query)
> result = mydb(query).select(*column_names)
> print db._lastsql
>
> This will print this into the log:
>
> DEBUG: query = record.application = 3) AND (record.entity = 24)) AND 
> (record.is_deleted = 'F')) AND ((record.is_deleted = 'F') AND 
> (record.string_1 = 'Puskás Ferenc')))
>
> Please observe the accented 'a' character: "á". Also, mydb equals to db in 
> this case. 
>
> This will raise this error (from the GAE logs):
>
> print db._lastsql File 
> "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/runtime/request_environment.py",
>  
> line 92, in write self._request.errors.write(data) File 
> "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/logservice/logservice.py",
>  
> line 286, in write for line in cStringIO.StringIO(lines): 
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in 
> position 212: ordinal not in range(128)
>
> However:
>
> 1. If I comment out the print db._lastsql part, my app suddenly works as 
> expected,
>
> 2. Except, querying on "Puskas Ferenc" and "Puskás Ferenc" both retrieves 
> the same item from the table (which has an "á").
>
> Maybe, can someone give me a hint on what's going on here?
>
> My server connection collation is set to utf8mb4_unicode_ci and the table 
> collation to utf8_general_ci (this was all default in Google Cloud SQL, I 
> have not changed them)
>
> 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: not authorised flash message when I used SQLFORM.grid, but worked fine with SQLFORM.smartgrid

2017-06-02 Thread Leandro Paz
Tenta colocar no SQLForm.grid o parâmetro: user_signature=False

Ficará assim:
grade = SQLFORM.grid (db.auth_user, user_signature = False)



-- 
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-02 Thread Dave S


On Wednesday, May 31, 2017 at 2:51:54 AM UTC-7, Ramos wrote:
>
> To Massimo... 
> maybe we can have something like this in future web2py versions...
>
> https://tg.pl/drab 
>

Is this particularly different from stupid.css, already include in the 
applications/examples in 2.14.6?

/dps
 

>
> 2017-05-31 2:08 GMT+01:00 Dave S :
>
>>
>>
>> On Tuesday, May 30, 2017 at 5:11:49 PM UTC-7, Ron Chatterjee wrote:
>>>
>>> Massimo, Do you see its better to do incremental changes to web2py that 
>>> leads us to web3py at some point than to a completely new framework which 
>>> may be lot of work and it will take monumental effort to fix all the bugs 
>>> it may have.Just some thoughts...
>>>  
>>>
>>
>>
>> Isn't he doing a parallel effort (with a few helpers)?  Much python3 work 
>> has found it's way into web2py, and some of that has been used for web3py, 
>> and conversely some of the web3py work has been backported.
>>
>> From what I've seen, it's not EXCLUSIVE-OR.
>>
>> /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+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: Future of web2py

2017-06-02 Thread eric cuver
lol

Le mercredi 31 mai 2017 21:21:40 UTC+2, Oasis Agano a écrit :
>
>
> But web2py is still maintained right? or we start buying flask books
> On Saturday, May 27, 2017 at 9:11:02 AM UTC+2, Andrea Fae' wrote:
>>
>> Hello guys,
>> I'd like to know if there will be future of web2py? Any information about 
>> it?
>> 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 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-02 Thread Marlysson Silva
o.O 

-- 
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: smartgrid edit form javascript calculation

2017-06-02 Thread Dave S


On Friday, June 2, 2017 at 4:00:54 AM UTC-7, T.R.Rajkumar wrote:
>
> Sorry. I am able to do it. In view new_contract.html I have now this.
>


I'm happy to hear that you've figured it out!

-d
 

> {{extend 'layout.html'}}
> New Contract
> {{=form}}
> 
> 
> 
>
> 
> jQuery(document).ready(function(){
>$("#amc_details_hsk").change(function(){
> calculate_rate();
> });
>$("#amc_details_sk").change(function(){
> calculate_rate();
> });
> $("#amc_details_ssk").change(function(){
> calculate_rate();
> });
> $("#amc_details_usk").change(function(){
> calculate_rate();
> });
> $("#amc_details_shift").change(function(){
> calculate_rate();
> });
> $("#amc_details_misc").change(function(){
> calculate_rate();
> });
>  $("#amc_details_eqty").change(function(){
> calculate_rate();
> });
>  $("#amc_details_unit").change(function(){
> calculate_rate();
> });
> });
>
> 
>
> Now I am able to set the rate for the job.
>
> Thanks for forbearing with me.
>

-- 
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-02 Thread Dave S


On Friday, June 2, 2017 at 6:48:18 AM UTC-7, Ramos wrote:
>
> Dont know where to start but meanwhile i share this post
>
>
> http://www.computerweekly.com/news/450419960/Top-UK-firms-websites-violate-key-GDPR-principle?utm_medium=EM=EM_EDA_77932701_campaign=20170601_Top%20UK%20firms%E2%80%99%20websites%20violate%20key%20GDPR%20principle_source=EDA
>
>
Yes, you started the thread with that link.  It doesn't provide much 
information, other than saying firms in the UK are doing automated data 
collection and not encrypting the data they have.

Are there any firms in your area offering training in GDPR?  

(I recently attedned the ISSA_LA Summit

and I know that some of the firms represented in the vendor fair do 
security-oriented training; Wombat Security Technologies is one of them

but one of their focus points is phishing-awareness, which isn't 
specifically a GDPR issue.)

(Massimo:  because you spoke at OWASP-OC a couple years ago, I've been 
attending their meetings, and won my Summit ticket as a door prize a couple 
of months ago.  And I've heard a bunch of interesting speakers, although 
I'm not going to be a pen tester.)

((The rest of you:  check if there's an OWASP or ISSA chapter near you!)

/dps



2017-06-02 12:48 GMT+01:00 Anthony :
>
>> On Friday, June 2, 2017 at 7:01:53 AM UTC-4, Ramos wrote:
>>>
>>> i think it will affect all of us and our apps...
>>>
>>
>> Right, but it's still not clear what functionality should be added to 
>> web2py specifically. Most of those issues probably have to be handled at 
>> the application level or the server level, not necessarily by the 
>> framework. But perhaps there are some things the framework can do to help. 
>> Do you have a link with any detailed specifications? Anything in particular 
>> you think the framework can offer to make things easier?
>>
>> 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+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: Any ideas on how to prepare web2py apps for GDPR

2017-06-02 Thread Dave S


On Friday, June 2, 2017 at 4:01:53 AM UTC-7, Ramos wrote:
>
> i think it will affect all of us and our apps...
> [image: Imagem inline 1]
>

Those all seem like something that could be handled by boilerplate links or 
check boxes in the footer of your pages:
"Click here to contact us about problems" "Click here to allow us to speed 
your next order by saving your details" and "Click here to allow us to 
provide information customized to your preferences".

/dps


 

> And more... Any company that does not adapt their apps to comply will 
> incur in a heavy fine...
>
> https://www.itgovernance.co.uk/dpa-penalties
>
>
> http://ec.europa.eu/justice/data-protection/reform/files/regulation_oj_en.pdf
>
>
> https://ico.org.uk/media/for-organisations/documents/1624219/preparing-for-the-gdpr-12-steps.pdf
>
>
> Regards
>
> 2017-06-02 3:44 GMT+01:00 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+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] user data, html5 sessionStorage, session

2017-06-02 Thread Pierre
Hi,

I'd like to dump a small set of user specific data on login (to keep this 
data "alive" during user session) but am not sure about the container ? 
should it be the session ( i also would like to store sessions in cookies), 
html5 sessionStorage, cache to disk..or perhaps this is a bad idea 
since there's little space available in cookies and local storage security 
and/or logic issues. 

i have read this article which seems quite anti-html5-local-storage
https://www.whitehatsec.com/blog/web-storage-security/
I don't understand how local storage could be utilized outside of the scope 
of an application "business logic" ?



-- 
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] not authorised flash message when I used SQLFORM.grid, but worked fine with SQLFORM.smartgrid

2017-06-02 Thread Rudy Leung
Hi Akshay,

I don’t know where the problem was. As mentioned in previous thread, after i 
used smartgrid to continue the development for a few days, it went away. One 
thing i notice is the editor from the administrative interface gets funny 
behavior sometimes, the compiler raises error but I simply can’t find what goes 
wrong with the specific line pointed out from the ticket, if I delete the line 
and retype exactly the same thing (I even had 2 lines side by side to compare 
the difference), the error goes away. But I can’t explain why below issue 
complains about “not authorised”, well try to refresh your editor or use 
another editor to check the code, perhaps restart web2py. I know it sounds 
silly, but they are quick test. cheers!

> On 2 Jun, 2017, at 7:07 pm, akshay05ku...@gmail.com wrote:
> 
> hi Rudy,
>I am facing the same issue. Did you get why this is happeneing?
> On Saturday, April 22, 2017 at 1:49:15 PM UTC+5:30, Rudy wrote:
> Hi there,
> 
> It feels really strange to me that when i used SQLFORM.grid(), I got a flash 
> message "not authorised", but when i used smartgrid(), it worked just fine 
> (in both cases i had logged in already). I tried to removed 
> @auth.requires_login(), but same behaviour happened. I seem to miss some very 
> fundamental knowledge using SQLFORM.grid(). Below is the simplified code. Any 
> help is much appreciated.
> 
> @auth.requires_login()
> def list_items2():
> response.view='accounting/list_items.html'
> grid = SQLFORM.grid(db.auth_user)
> return locals()
> 
> -- 
> 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/yhj6iVXgHEM/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] how to make a SQLFORM field writable temporary for jQuery to change its value

2017-06-02 Thread Rudy
I have an update SQLFORM for quotation table, i want to make 
all_items_total and quote_amount not writable by user because 
all_items_total should be the sum of all the items belong to this 
quotation, not enter by user. The quote_amount should be all_items_total 
minus discount, so when the user changes the discount value on the SQLFORM, 
jQuery should detect the change and make a callback to return the 
quote_amount, finally update the field with specific id. All those ajax and 
callback worked fine when i had db.quotation.all_items_total.writable=True 
& db.quotation.quote_amount.writable=True. However, when I finally changed 
them to False, first I couldn't pick up the value of all_items_total which 
is highlighted in red below inside the ajax function, but 
the change_discount_callback was called, obviously error was raised because 
all_items_total passed from ajax to callback function was empty. Then i 
tried to add another ajax callback to simply change those 2 field's 
writable to True (temporary), it went through but same issue happened. 
Surely if all the above worked, i still had to update the quote_amount on 
the form display with value returned from callback. I have been stuck for 
1.5 days, any help is much appreciated. Thanks!

db.define_table('quotation',
Field('customer', 'reference customer'),
Field('all_items_total', 'double', default=0),
Field('discount', 'double', default=0, label='Discount %'),
Field('quote_amount', 'double', default=0),
auth.signature)

db.define_table('quote_item',
Field('quotation', 'reference quotation',  writable=False, 
label='Quote Id'),
Field('product'),
Field('quantity', 'integer', default=1),
auth.signature)

def edit_quote():
db.quotation.all_items_total.writable = False
db.quotation.quote_amount.writable = False
quote_id = request.args(0)
quote_row = db.quotation(quote_id)
form=SQLFORM(db.quotation, quote_row, labels={'id':'Quote 
Id'}).process()
return locals()


jQuery(document).ready(function(){

function do_ajax_change_discount(t, discount, all_items_total){
jQuery.ajax({method:'post', url:'{{=URL('change_discount_callback')}}',
 data:{'discount':discount, 
'all_items_total':all_items_total},
 success: function(data){
 result = JSON.parse(data)

 jQuery('#quotation_quote_amount').val(result.quote_amount);
});
}
jQuery('#quotation_discount').change(function(){
var discount = jQuery('#quotation_discount').val();
var all_items_total = jQuery('#quotation_all_items_total').val();
do_ajax_change_discount(this, discount, all_items_total);
});
});


def change_discount_callback():
vars=request.post_vars
if vars:
discount = float(vars.discount)
all_items_total = float(vars.all_items_total)
quote_amount = all_items_total * (100 - discount)/100
else:
print "request.post_vars is None" 
return simplejson.dumps(dict(quote_amount=quote_amount))

-- 
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] auth_user email field

2017-06-02 Thread Andrea Fae'
Email field in auth_user table is obligatory.
Is it possible to get this field not obligatory?
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 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: 'validate_and_insert' throws error each time on latest version where it was fine before on prev version

2017-06-02 Thread Anthony
Can we see the code and full traceback?

-- 
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 question db.table(field1=value1,field2=value)

2017-06-02 Thread Anthony
Yes, that is for finding just one record.

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


[web2py] DAL question db.table(field1=value1,field2=value)

2017-06-02 Thread António Ramos
db.table(field1=value1,field2=value)

Hi, i use this kind of query but i noticed it only returns one row.



Is this correct ?

can i use it as a "find one" function?

regards

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


[web2py] Hide breadcrumbs

2017-06-02 Thread Daniela Ortiz


Is there any way to hide breadcrumbs of smartgrid? 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 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] problem submitting a form

2017-06-02 Thread icodk
I created a formstyle that can show fields on different tabs (booustrap) in 
an sqlform.grid or smartgrid. edit/create/vew forms
based on bootstrap3_inline.
However now the edit /create forms do not submit
I have a demo app that I can mail to anybody interested. I could not attach 
it to this post (?)
You must register for some reason, I have no @auth.requires_login() decoration 
on any function
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 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: 'validate_and_insert' throws error each time on latest version where it was fine before on prev version

2017-06-02 Thread Jordan Ladora
Hi Anthony,

Thanks for your response. 

I didn't use the admin gui to upgrade but rather DL'd the new src zip and 
moved my app into it and then replaced all the files within the app that 
get upgraded (like static, languages, some of the views, etc.) 

I just checked that everything has been upgraded, incl pydal. 

-j



On Friday, June 2, 2017 at 5:56:11 AM UTC-6, Anthony wrote:
>
> How did you upgrade? Is it possible you did not upgrade PyDAL or get its 
> proper version?
>
> Anthony
>
> On Thursday, June 1, 2017 at 11:00:11 PM UTC-4, Jordan Ladora wrote:
>>
>> 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.


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

2017-06-02 Thread António Ramos
Dont know where to start but meanwhile i share this post

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

2017-06-02 12:48 GMT+01:00 Anthony :

> On Friday, June 2, 2017 at 7:01:53 AM UTC-4, Ramos wrote:
>>
>> i think it will affect all of us and our apps...
>>
>
> Right, but it's still not clear what functionality should be added to
> web2py specifically. Most of those issues probably have to be handled at
> the application level or the server level, not necessarily by the
> framework. But perhaps there are some things the framework can do to help.
> Do you have a link with any detailed specifications? Anything in particular
> you think the framework can offer to make things easier?
>
> 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: 'validate_and_insert' throws error each time on latest version where it was fine before on prev version

2017-06-02 Thread Anthony
How did you upgrade? Is it possible you did not upgrade PyDAL or get its 
proper version?

Anthony

On Thursday, June 1, 2017 at 11:00:11 PM UTC-4, Jordan Ladora wrote:
>
> 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: grid add/edit form label

2017-06-02 Thread Anthony
Instead of:

editargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'},
amc_details={'qty':'Quantity'})}

Try:

formargs={'amc_master': dict(labels=[{'lrrflg': 'Rate Revision'}],
  'amc_details': dict(labels=[{'qty': 'Quantity'}])}

Anthony

On Friday, June 2, 2017 at 1:31:24 AM UTC-4, T.R.Rajkumar wrote:
>
> 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.


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

2017-06-02 Thread Anthony
On Friday, June 2, 2017 at 7:01:53 AM UTC-4, Ramos wrote:
>
> i think it will affect all of us and our apps...
>

Right, but it's still not clear what functionality should be added to 
web2py specifically. Most of those issues probably have to be handled at 
the application level or the server level, not necessarily by the 
framework. But perhaps there are some things the framework can do to help. 
Do you have a link with any detailed specifications? Anything in particular 
you think the framework can offer to make things easier?

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: not authorised flash message when I used SQLFORM.grid, but worked fine with SQLFORM.smartgrid

2017-06-02 Thread akshay05kumar
hi Rudy,
   I am facing the same issue. Did you get why this is happeneing?
On Saturday, April 22, 2017 at 1:49:15 PM UTC+5:30, Rudy wrote:
>
> Hi there,
>
> It feels really strange to me that when i used SQLFORM.grid(), I got a 
> flash message "not authorised", but when i used smartgrid(), it worked just 
> fine (in both cases i had logged in already). I tried to removed 
> @auth.requires_login(), but same behaviour happened. I seem to miss some 
> very fundamental knowledge using SQLFORM.grid(). Below is the simplified 
> code. Any help is much appreciated.
>
> @auth.requires_login()
> def list_items2():
> response.view='accounting/list_items.html'
> grid = SQLFORM.grid(db.auth_user)
> return locals()
>

-- 
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-02 Thread António Ramos
i think it will affect all of us and our apps...
[image: Imagem inline 1]
And more... Any company that does not adapt their apps to comply will incur
in a heavy fine...

https://www.itgovernance.co.uk/dpa-penalties

http://ec.europa.eu/justice/data-protection/reform/files/
regulation_oj_en.pdf

https://ico.org.uk/media/for-organisations/documents/1624219/preparing-for-the-gdpr-12-steps.pdf


Regards

2017-06-02 3:44 GMT+01:00 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.
>

-- 
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: smartgrid edit form javascript calculation

2017-06-02 Thread T.R.Rajkumar
Sorry. I am able to do it. In view new_contract.html I have now this.
{{extend 'layout.html'}}
New Contract
{{=form}}





jQuery(document).ready(function(){
   $("#amc_details_hsk").change(function(){
calculate_rate();
});
   $("#amc_details_sk").change(function(){
calculate_rate();
});
$("#amc_details_ssk").change(function(){
calculate_rate();
});
$("#amc_details_usk").change(function(){
calculate_rate();
});
$("#amc_details_shift").change(function(){
calculate_rate();
});
$("#amc_details_misc").change(function(){
calculate_rate();
});
 $("#amc_details_eqty").change(function(){
calculate_rate();
});
 $("#amc_details_unit").change(function(){
calculate_rate();
});
});



Now I am able to set the rate for the job.

Thanks for forbearing with me.

-- 
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] smartgrid edit form javascript calculation

2017-06-02 Thread T.R.Rajkumar
In model I have this 

db.define_table('amc_details',
Field('amc_id','reference 
amc_master'),   
Field('jcod', 
type='string',required='True',notnull='True',length=10),

Field('jobdesc',type='string',required='True',notnull='True',length=250),

Field('rqty',type='decimal(18,2)',required='True',notnull='True'),

Field('rrate',type='decimal(18,2)',required='True',notnull='True'),

Field('qty',type='decimal(18,2)',required='True',notnull='True'),

Field('rate',type='decimal(18,2)',required='True',notnull='True'),

Field('amt',type='decimal(18,2)',required='True',notnull='True'),

Field('hsk',type='decimal(18,5)',required='True',notnull='True'),

Field('sk',type='decimal(18,5)',required='True',notnull='True'),

Field('ssk',type='decimal(18,5)',required='True',notnull='True'),

Field('usk',type='decimal(18,5)',required='True',notnull='True'),

Field('shift',type='decimal(18,5)',required='True',notnull='True'),

Field('eqty',type='decimal(18,2)',required='True',notnull='True'),

Field('misc',type='decimal(18,2)',required='True',notnull='True'),

Field('unit',type='decimal(18,2)',required='True',notnull='True'),

Field('uom',type='string',required='True',notnull='True',length=16),
Field('justn',type='text',required='True',notnull='True'),
Field('scope',type='text',required='True',notnull='True'),

Field('aflg',type='string',length=1,required='True',notnull='True'),

Field('update_uid','string',length=6,required='True',notnull='True',default 
= session.uname),

Field('update_dt','datetime',required='True',notnull='True',default=request.now)
)

In controller 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   
)

Now when I click Add record of the child I get this. 
http://127.0.0.1:8000/web_ocms/amc/new_contract/amc_master/amc_details.amc_id/3/new/amc_details

Here as the user inputs I would like to calculate the rate as 
(hsk+sk+ssk+usk)*shift/eqty

This calculation I would like to do in javascript  and populate the rate 
field of the above view. 

Where to write the javascript onchange functiion. I have only 
new_contract.html only. 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] Re: How to speed up query processing in web2py's sqlite?

2017-06-02 Thread Carlos Kitu
As Leonel mentioned, index creation will be your best friend in this issue.

I have  been using web2py during the last two years, and till now, I had no 
concerns about database performance because I was working in intranet 
applications without a big volume of data.
In the latest project we had a bigger volumen and I needed to tune the 
things up. The process was:

   - Identify the slow queries: 
  - you can just print in the console the db(...)._select(..) (don't 
  miss the underscore) to get the sql translation of the DAL method.
  - another practical way is to include in your view 
  {{=response.toolbar}} where you can see de sql queries executed and their 
  timings.
   - Once you know where to focus, you can use the database command line 
   and get the query plan. In sqlite:
  - explain query plan SELECT ..   (here you put the query obtained 
  in the previous step)
  - I got something like this:
  - 0|0|0|SCAN TABLE articulo AS art_PO
  0|1|1|SEARCH TABLE familia USING AUTOMATIC COVERING INDEX (id_familia
  =? AND centro=?)
  0|2|2|SEARCH TABLE articulo AS art_NA USING AUTOMATIC COVERING INDEX (
  familia=?)
  0|3|3|SEARCH TABLE vinculo USING AUTOMATIC COVERING INDEX (vinculacion
  =? AND articulo_NA=? AND articulo_PO=?)
  0|4|4|SEARCH TABLE consulta USING AUTOMATIC COVERING INDEX (vinculo=? 
  AND masreciente=?)
  0|0|0|USE TEMP B-TREE FOR ORDER BY
  - Those AUTOMATIC COVERING INDEX means that sqlite analyzed the query 
  and decided it made sense to create a temporary index to get the data 
  faster, instead of scanning the full table. That temporary index is 
deleted 
  after the query is executed. In englisht it means: *please create an 
  index for this table with the columns in the parenthesis*, i.e., 
  create one index for familia with columns id_famiia and centro.
   - Implicit joins vs explicit joins: the sql-92 recommendation is to use 
   explicit joins. It should be the same, but the last days I learnt that in 
   DAL, the implicit joins translate sometimes to a query with CROSS JOIN 
   while explicit joins translate to INNER JOIN. The results are the same 
   records, but I'm under the impression that the CROSS JOIN make a cartesian 
   product of the records in the joined tables, and then filters out according 
   to the WHERE CLAUSE, while INNER JOIN makes a faster query. With a low 
   number of records you will see no timing difference, but when there is a 
   big number of records there can be a big difference. I said I'm under the 
   impression, because it should be the same, but I kept getting a slow query 
   after creating indexes, and the timing only got right when I converted an 
   implicit join into an explicit join.
   - Here you have an example of implicit versus explicit:
  - Implicit join: db(db.dogs.owner == db.owner.id).select()
  - This translates to: SELECT * from dogs, owner where dogs.owner = 
  owner.id , or maybe SELECT * from dogs CROSS JOIN owner where dogs.owner 
= 
  owner.id. I have seen both results with different more complex queries. I 
  didn't test this example.
  - Explicit join: 
  db(db.dogs.id>0).select(join=[db.owner.on(db.dogs.owner == db.owner.id), 
])
  - This translates to: SELECT * from dogs JOIN owner ON db.dogs.owner 
  == db.owner.id 
  - After this experience, I realized that explicit joins are easier to 
  read than implicit joins, and in one case it supposed a performance 
gain(in 
  that case there was a main table with a join with a secondary table with 
  two aliases: see this link 
  

  )
   
There is very skilled people in the database field in this group and it 
would be great if they could clarify any misunderstanding in this post.
Best regards.

El jueves, 1 de junio de 2017, 11:04:09 (UTC+2), Mike Stephenson escribió:
>
> 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: SQLFORM.grid change form vars

2017-06-02 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.


[web2py] Re: SQLFORM.grid change form vars

2017-06-02 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.