[web2py] Re: Advice needed on complex SQL operation

2017-06-29 Thread Karoly Kantor
Thank you, that looks helpful, I will start along these lines. I have some 
questions, though:

1. Will this work if more than one fields are set to "group"? 

2. What's up with count, does it ever make sense to have more than one 
field set to "count", and if yes, what would be the difference between 
them? 

-- 
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] Advice needed on complex SQL operation

2017-06-28 Thread Karoly Kantor
I am hoping someone more experienced could give me some advice on how best 
to proceed with this:

I have a large table with columns C1, C2, C3,  Cx

I have a user defined filter, e.g. select those where C1 = "active" and C2 
> 2017.01.01. I have already implemented this, based on user input, i am 
dynamically building my query.

Now I would like to enable users to build dynamic reports with grouping, 
counting, etc, e.g.

1. User specifies C3 to be grouped on
2. User also specifies C4 to be grouped on
3. User wants to see count on those
4. User also wants, for each group and sub-group, the sum of C5

Example output would be:

C3C4   Count Sum_of_C5
Italy Verona   3 145
Italy Palermo  12230
FranceToulon   1 2
FranceParis102   240

(Meaning, there are 3 items from Verona, Italy, and the sum of column C5 
for those 3 items is 145, etc.)

Remember all of this is dynamically user specified: what columns to group 
on (C3 and C4, and what columns to sum, in this case, C5)

I am sure there are several ways of achieving this. I am hoping someone has 
some idea on how to make this as easy as possible.

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] google_adapters.py vs google.py

2017-06-21 Thread Karoly Kantor
I am using a web2py version from http://web2py.com/init/default/download, 
column "for normal users", "source code". I am under the impression that 
this is the latest official stable release. In gluon/packages/pdal/adapters 
it has a file named *google_adapters.py*.

Now I am trying to test a fix to this, for issue 1613, and it seems to have 
a change to a file named .../pdal/adapters/*google.py*

At what point did *google_adapters.py* become *google.py*? What should I do 
now to test the new version? (I mean, what to replace from where?)

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: Newbie question about github / trunk

2017-06-21 Thread Karoly Kantor
Sorry I don't get it. The code under that link seems old to me, the 
particular pdal adapter file I am interested in is from 2016 May 10.

On Wednesday, June 21, 2017 at 10:05:03 AM UTC+2, 黄祥 wrote:
>
> in http://web2py.com/init/default/download you can see there are several 
> links for tester (trunk)
> e.g. for source code
> https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip
>
> 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] Newbie question about github / trunk

2017-06-21 Thread Karoly Kantor
I raised an issue in github about Google Cloud SQL ( 
https://github.com/web2py/web2py/issues/1613 ), and I received a request to 
test the new code in trunk. I have never used trunk and I have no idea 
where to find it, can someone point me to the right direction, please?

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: gae issue when using two independent apps with same data model under one project

2017-06-19 Thread Karoly Kantor
You can definitely create a new project, that is sure to work.

Otherwise, I am also somewhat confused with the nomenclature, so I asked 
the question in the Google App Engine forum, you can follow any potential 
explanations here:

https://groups.google.com/forum/?fromgroups#!topic/google-appengine/UKfHKEOG7yc



On Friday, June 16, 2017 at 5:11:34 PM UTC+2, 98u...@gmail.com wrote:
>
> Hello,
> I uploaded a simple web2py app named 'mynotes', (based on markmin app 
> example) to gae under a project 'projectnotes' to keep my notes in. Very 
> simple model:
> db.define_table('tblpage',
> Field('page_title','string',label='Title'),
> Field('page_text','text',label='Text'))
> All works fine in gae.
> Then I was working on a different app and I decided to keep notes in gea 
> for it as well. So I created a new web2py app named 'mechnotes' based on 
> 'mynotes' app. Everything the same except their names. I uploaded both apps 
> to gae under the same project name: 'projectnotes'.
> Here is the problem: the second app uses the table and the content of the 
> first app! So I cannot create separate, independent notes in my second app.
> Could the 'rname' parameter in the table definition be used to create 
> application unique table names? 
> Thank you in advance.
>
>

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


Re: [web2py] Re: Future of web2py

2017-06-12 Thread Karoly Kantor


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

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

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

 

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

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


Re: [web2py] Architectural advice needed: background report generation (on GAE)

2017-06-10 Thread Karoly Kantor
Thank you, most helpful!

On Saturday, June 10, 2017 at 7:20:30 PM UTC+2, Mathieu Clabaut wrote:
>
> I think I would use a GAE task queue (it allows for longer run time and 
> does not take process power from actual page rendering).
> The queue controller would generate the report and send a mail or change a 
> database value upon completion.
>
> from google.appengine.api import taskqueue
>
> def action():
>…
>taskqueue.add(url=URL(f='generate_report'),
> params={'userid': row.id})
>
> def generate_report():
>userid = request.vars.userid
>…
>
> ​
>
> On Sat, Jun 10, 2017 at 10:54 AM Karoly Kantor  > wrote:
>
>> I have a rather complex data base structure on which I need to enable 
>> users to define various reports and run them in the background. (As the 
>> generation time might exceed what is acceptable real-time.) I want to 
>> enable users to launch the generation of these reports and then get a 
>> notification when the report is done and ready for download. I am on Google 
>> App Engine / Cloud SQL.
>>
>> 1. What are my architectural options to achieve this? What is the 
>> recommended setup?
>> 2. How can I ensure that background report generation is done with lower 
>> priority than real time page requests, to make sure that background report 
>> generation jobs will not degrade primary user experience?
>>
>> 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+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] Architectural advice needed: background report generation (on GAE)

2017-06-10 Thread Karoly Kantor
I have a rather complex data base structure on which I need to enable users 
to define various reports and run them in the background. (As the 
generation time might exceed what is acceptable real-time.) I want to 
enable users to launch the generation of these reports and then get a 
notification when the report is done and ready for download. I am on Google 
App Engine / Cloud SQL.

1. What are my architectural options to achieve this? What is the 
recommended setup?
2. How can I ensure that background report generation is done with lower 
priority than real time page requests, to make sure that background report 
generation jobs will not degrade primary user experience?

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: Adding extra form elements to SQLFORM

2017-06-05 Thread Karoly Kantor
Thanks.

On Monday, June 5, 2017 at 2:36:50 PM UTC+2, Anthony wrote:
>
> The element you are inserting must have the proper HTML structure 
> (including CSS classes) to fit into the form. Use the browser DOM inspector 
> to get an idea what the HTML should look like for a field in the form.
>
> Anthony
>
> On Monday, June 5, 2017 at 4:19:29 AM UTC-4, Karoly Kantor wrote:
>>
>> I am having trouble properly formatting my extra elements to match the 
>> rest of the form.
>>
>> This is a quote from the web2py book below. Can someone tell me what is 
>> exactly meant by "*The variable my_extra_element should be adapted to 
>> the formstyle*"?
>>
>> I am using bootsrap3_inline as formstyle, and all the parts of my extra 
>> element show up in the leftmost column.
>>
>> Adding extra form elements to SQLFORM
>>
>> Sometimes you may wish to add an extra element to your form after it has 
>> been created. For example, you may wish to add a checkbox which confirms 
>> the user agrees with the terms and conditions of your website:
>>
>> 1
>> 2
>> 3
>>
>> form = SQLFORM(db.yourtable)my_extra_element = TR(LABEL('I agree to the 
>> terms and conditions'),   
>> INPUT(_name='agree',value=True,_type='checkbox'))form[0].insert(-1,my_extra_element)
>>
>> *The variable my_extra_element should be adapted to the formstyle.* In 
>> this example, the default formstyle='table3cols' has been assumed.
>>
>

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

2017-06-05 Thread Karoly Kantor
Dear Massimo,

I saw your question in the developers group where I cannot post, therefore 
i do it here.

I am currently aware of the following issues to be fixed:

1. Google 2nd generation SQL is definitely a problem. Please note I made a 
temporary hack to fix it, described 
here: https://groups.google.com/forum/?fromgroups=#!topic/web2py/vs39zZpaH7g

2. We have a long overdue issue with the password reset emails not sending 
on GAE (), I am using a temporary dirty workaround that sends a plain text 
new password, search for the issue about "lazyT" object being passed to 
GAE".

3. I am having trouble making the date picker work nicely across all 
browsers, especially where there is a native solution. Microsoft Edge is 
the worst case. In general, would be good to have a nicer date picker

4. General comment: We have "batteries included", however, some of those 
batteries now have much newer versions than included, e.g. bootstrap




-- 
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] Adding extra form elements to SQLFORM

2017-06-05 Thread Karoly Kantor
I am having trouble properly formatting my extra elements to match the rest 
of the form.

This is a quote from the web2py book below. Can someone tell me what is 
exactly meant by "*The variable my_extra_element should be adapted to the 
formstyle*"?

I am using bootsrap3_inline as formstyle, and all the parts of my extra 
element show up in the leftmost column.

Adding extra form elements to SQLFORM

Sometimes you may wish to add an extra element to your form after it has 
been created. For example, you may wish to add a checkbox which confirms 
the user agrees with the terms and conditions of your website:

1
2
3

form = SQLFORM(db.yourtable)my_extra_element = TR(LABEL('I agree to the terms 
and conditions'),   
INPUT(_name='agree',value=True,_type='checkbox'))form[0].insert(-1,my_extra_element)

*The variable my_extra_element should be adapted to the formstyle.* In this 
example, the default formstyle='table3cols' has been assumed.

-- 
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-05-30 Thread Karoly Kantor
Hello Massimo, May I have two questions on this?

1. You say current web2py interprets code on every request. What does this 
mean on Google App Engine? (Every time I deploy, GAE seems to compile...)

2. Overall, what do your plans exactly mean for people with an existing app 
on web2py? Is this a brand new and different framework or is there an 
upgrade path?

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] Strange behaviour of SQL query on accented characters

2017-05-30 Thread Karoly Kantor
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: "á"

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: Is web2py incompatible with 2nd generation Google Cloud SQL ?

2017-05-24 Thread Karoly Kantor
I have temporarily solved this problem, as described here:

https://groups.google.com/forum/?fromgroups=#!topic/web2py/vs39zZpaH7g

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


[web2py] Re: web2py uses deprecated driver to connect to Google Cloud SQL

2017-05-24 Thread Karoly Kantor
In the meantime, I have solved the syntax error above (there was a "-" in 
the data base name...), and I have successfully connected to a 2nd 
generation Google SQL instance 

To do this, i had to hack pyDAL. I would appreciate of someone could look 
at what I have done, and tell me if this is a viable long term solution, or 
i will be running into some problems later. (I have not fully tested my app 
on the new DB yet.)

So I have added this to app.yaml:

env_variables:
CLOUDSQL_USER: root
CLOUDSQL_PASSWORD: password
CLOUDSQL_CONNECTION_NAME: myproject:europe-west1:myinstance
CLOUDSQL_DATABASE: mydbname

libraries:
- name: MySQLdb
  version: "latest" 


Then I changed google_adapters.py :

*import MySQLdb*



class GoogleSQLAdapter(UseDatabaseStoredFile, MySQLAdapter):
uploads_in_blob = True

REGEX_URI = re.compile('^(?P.*)/(?P.*)$')

def clear_cache(self):
ndb.get_context().clear_cache()

def ignore_cache_for(self, entities = None):
entities = entities or []
ndb.get_context().set_cache_policy(lambda key: key.kind() not in 
entities)

def __init__(self, db, uri='google:sql://realm:domain/database',
 pool_size=0, folder=None, db_codec='UTF-8',
 credential_decoder=IDENTITY, driver_args={},
 adapter_args={}, do_connect=True, after_connection=None):

self.db = db
self.dbengine = "mysql"
self.uri = uri
self.pool_size = pool_size
self.db_codec = db_codec
self._after_connection = after_connection
if do_connect: self.find_driver(adapter_args, uri)
self.folder = folder or pjoin('$HOME',THREAD_LOCAL.folder.split(
os.sep+'applications'+os.sep,1)[1])
ruri = uri.split("://")[1]
m = self.REGEX_URI.match(ruri)
if not m:
raise SyntaxError("Invalid URI string in SQLDB: %s" % self.uri)
instance = credential_decoder(m.group('instance'))
self.dbstring = db = credential_decoder(m.group('db'))
driver_args['instance'] = instance

*#KK's addition to attempt fix 2nd gen problem with missing user 
name and password:*
*driver_args['user'] = os.environ.get('CLOUDSQL_USER')*
*driver_args['passwd'] = os.environ.get('CLOUDSQL_PASSWORD') *
*driver_args['unix_socket'] = os.path.join('/cloudsql', 
os.environ.get('CLOUDSQL_CONNECTION_NAME')) *
*del driver_args['instance']*
*#driver_args['database'] = os.environ.get('CLOUDSQL_DATABASE') 
  *
*#END KK*

if not 'charset' in driver_args:
driver_args['charset'] = 'utf8'
self.createdb = createdb = adapter_args.get('createdb',True)
if not createdb:
driver_args['database'] = db

#KK added this for debug:
print "DEBUG: driver args = " + str(driver_args) 
print "DEBUG: self.dbstring = " + str(self.dbstring)   
#END KK

*#KK changed rdbms to MySQLdb: *   
def connector(driver_args=driver_args):
return *MySQLdb*.connect(**driver_args)
self.connector = connector
if do_connect: self.reconnect()

def after_connection(self):
if self.createdb:
# self.execute('DROP DATABASE %s' % self.dbstring)
self.execute('CREATE DATABASE IF NOT EXISTS %s' % self.dbstring)
self.execute('USE %s' % self.dbstring)
self.execute("SET FOREIGN_KEY_CHECKS=1;")
self.execute("SET sql_mode='NO_BACKSLASH_ESCAPES';")

def execute(self, command, *a, **b):
return self.log_execute(command.decode('utf8'), *a, **b)

def find_driver(self,adapter_args,uri=None):
self.adapter_args = adapter_args
self.driver = "google"

-- 
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] web2py uses deprecated driver to connect to Google Cloud SQL

2017-05-24 Thread Karoly Kantor
I have been unable to connect to a 2nd generation Google SQL instance for 
quite a time now. This is painful as 1st generation instances are less 
capable and declared "legacy" by Google.

I suspect it may have to do with web2py using a deprecated driver "rdbms", 
e.g. in google_adapters.py. According to Google, this has been long 
deprecated and "future versions of Cloud SQL will not be supported by the 
legacy drivers" - a quote from 2015.

Read here:

https://groups.google.com/forum/#!topic/google-cloud-sql-announce/4m3_GPhm444

In fact, I have tried to hack google_adapters.py to use the Google 
recommended MySQLdb driver instead of the old rdbms. I also had to change 
some of the args to it. Suddenly, I was able to connect to the 2nd 
generation SQL instance, only to fail a little later with 

ProgrammingError: (1064, "You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right syntax 
to use near '-prod' at line 1")

This is where my current knowledge stops, I am hoping some insider could 
help.

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: Is web2py incompatible with 2nd generation Google Cloud SQL ?

2017-05-23 Thread Karoly Kantor
Dear Massimo,

I am only writing again as a reminder because you said last month you would 
look into this asap. This is very important I think as one of the key 
offerings of web2py, supporting GAE, seems to be broken. At least for me.

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] web2py.com is not responding

2017-05-18 Thread Karoly Kantor
web2py.com is not responding!

-- 
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] Language file on GAE

2017-05-16 Thread Karoly Kantor
Thank you, that's helpful.

-- 
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] Language file on GAE

2017-05-15 Thread Karoly Kantor
No, my language file is not updated. My local env is set to use Datastore.

-- 
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] Language file on GAE

2017-05-15 Thread Karoly Kantor
I understand web2py would generate my language file (e.g. it.py) in 
runtime, except on GAE. Now, I am on GAE.

What would be my best workaround? Could I somehow still force web2py update 
this file while I am local on my laptop?

Without this, this piece of work becomes enormous... :-(


-- 
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 easy way to prevent left_sidebar from scrolling down?

2017-05-15 Thread Karoly Kantor
Yes, it works on the laptop, but sidebar and main content suddenly 
completely overlap as I decrease window size.

On Monday, May 15, 2017 at 11:45:41 AM UTC+2, Pierre wrote:
>
> this might help:
>
> https://www.w3schools.com/bootstrap/bootstrap_affix.asp
>
> howewer i am not sure this is very responsive-design compatible. It might 
> become hazardeous as viewport is shrinked
>

-- 
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 easy way to prevent left_sidebar from scrolling down?

2017-05-14 Thread Karoly Kantor
I would like a table of contents in the left sidebar that does not scroll 
down with the main text. I have been unsuccessful with "position: fixed" as
things start to overlap and I can prevent it only with dirty hacks such as 
a large margin, but that looks ban on a small screen.

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] Google Cloud SQL users of the world, unite!

2017-05-13 Thread Karoly Kantor
I would like to share experiences, so I would kindly ask anyone using 
Google Cloud SQL to sign in here.

Specially interesting would be

- if you are on 1st or 2nd generation SQL instances
- what tier of instance you are using
- what are your observations on performance

-- 
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: Expected behaviour of IS_IN_SET(set) if set is empty ?

2017-05-13 Thread Karoly Kantor
Thanks Anthony.

The code you proposed gives an error on widget=SQLFORM.widgets.options.
widget: TypeError: append() takes no keyword arguments

I admit the user experience is odd, but you see, the "set" being empty is 
the result of user activity, or lack thereof. This way the form submission 
will always be impossible, and the error message will remind the users that 
there is some configuration steps they should have completed elsewhere 
before using this feature.


On Friday, May 12, 2017 at 9:15:42 PM UTC+2, Anthony wrote:
>
> It seems like you are aiming for an odd user experience -- in some cases 
> you provide a select widget that has no options, and when the user submits 
> the form, it returns an error saying the field cannot be empty -- yet there 
> is no way to provide a value. What is the user supposed to do in that case?
>
> Anyway, you can do it this way:
>
> Field("value", type='string', label=field_name, default=value,
>   requires=IS_IN_SET(set, multiple=(1, 2), error_message='Field 
> cannot be empty'),
>   widget=SQLFORM.widgets.options.widget)
>
> Setting multiple=(1, 2) indicates there must be at least one option 
> selected but less than 2 (i.e., so, exactly 1). However, by specifying the 
> "multiple" argument, the default widget would become the multi-select 
> widget, so to get a standard select widget, you must also specify that via 
> the "widget" argument.
>
> Anthony
>
> On Friday, May 12, 2017 at 2:43:00 AM UTC-4, Karoly Kantor wrote:
>>
>> I have a situation where the "set' in IS_IN_SET(set) is dynamic, and 
>> sometimes will be empty in:
>>
>> form = SQLFORM.factory(
>> Field("value", type='string', label=field_name, default=value, 
>> requires=IS_IN_SET(set)),
>> ... more fields ...
>> )
>>
>> I would expect that if 'set' is empty, this would always fail validation. 
>> However, this one allows saving an empty value.
>>
>> How could I make it to always fail validation if the set is empty?
>>
>> I also tried this:
>>
>> requires= [IS_NOT_EMPTY(), IS_IN_SET(set) ]
>>
>> But this one brings up a simple text input field and accepts any text I 
>> type.
>>
>> 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] Expected behaviour of IS_IN_SET(set) if set is empty ?

2017-05-11 Thread Karoly Kantor
I have a situation where the "set' in IS_IN_SET(set) is dynamic, and 
sometimes will be empty in:

form = SQLFORM.factory(
Field("value", type='string', label=field_name, default=value, 
requires=IS_IN_SET(set)),
... more fields ...
)

I would expect that if 'set' is empty, this would always fail validation. 
However, this one allows saving an empty value.

How could I make it to always fail validation if the set is empty?

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] How can I make a form's action=... in a component return me within the component?

2017-05-03 Thread Karoly Kantor
I understand i can achieve this for links by inserting "cid=request.cid" 
into the A helper.

However, if I have my form in a component's view as below, how can I 
achieve the same thing?



One
Two
Three
Four



This will, upon form submit, open the component "filter" in a new full 
empty screen now.

-- 
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: Why do the devs hate GAE? (two huge bugs and their stupid solutions)

2017-05-02 Thread Karoly Kantor

Dear Massimo,

As you are looking into this particular issue, may I please suggest that 
you test it with a 2nd generation Google Cloud SQL instance? That would, 
with the same effort, automatically address the issue I have raised 
earlier. (Google declared 1st generation Cloud SQL instances "legacy", so 
this seems logical anyway.)

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: Is web2py incompatible with 2nd generation Google Cloud SQL ?

2017-04-27 Thread Karoly Kantor
Hello Massimo,

One more piece of information that might be useful:

One Google support person at the "Google App Engine" forum here told me my 
login attempt was made with password "password", which is NOT the password 
I set into the environment variable as seen in my attempted hack above, as 
the App Engine log mentions "password=password" before the connection 
refusal message. This might mean than my hack was unsuccessful due to 
insufficient understanding of web2py internals.

-- 
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] Type of boolean queried from MYSQL: is this a bug of a feature?

2017-04-27 Thread Karoly Kantor
I had some difficult time with handling boolean values from MySQL.

When I define a table with *db.define_table* and in the Field constructor 
define *type='boolean'*, the column in the data base becomes a *char(1)*. 
Values 
are "*T*" of "*F*".

Now when I do a query/select and iterate through the rows, and do  *x = 
row.column_name* I receive an *x* value of type  Values are "*T*" 
of "*F*".


However, if I do a direct *record = db.table[id]*, and then *x = 
record['column_name']* , my *x* variable becomes of type  Values 
are *True* or *False*.


Obviously, my code that was trying to do *if x:* was behaving quite 
differently depending on the way the value was retrieved.


My eventual fix was to check if *x* was True or "T".


Is this a bug or a feature, or what is it I did wrong?

-- 
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 change menu bar background and font colors

2017-04-27 Thread Karoly Kantor
Thank you, those are really helpful. I have learned again. :-)


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


[web2py] Re: Is web2py incompatible with 2nd generation Google Cloud SQL ?

2017-04-26 Thread Karoly Kantor
Thanks, Massimo.

FYI, some more info that might be helpful in your investigation:

Google docs tell me that my app is granted access to the SQL instance by 
default, as it is in the same project with the Cloud SQL license, so 
there's nothing to do there. Also, I set a password for the root user in 
the data base user management menu. The I created two environment variables 
in app.yaml as proposed by Google. 

Then I tried a temporary hack in *google_adapters.py* to send user name and 
pasword to Google SQL, but the connection was still refused. I hope I did 
something wrong and you will be able to pinpoint it:

class GoogleSQLAdapter(UseDatabaseStoredFile, MySQLAdapter):
uploads_in_blob = True

REGEX_URI = re.compile('^(?P.*)/(?P.*)$')

def clear_cache(self):
ndb.get_context().clear_cache()

def ignore_cache_for(self, entities = None):
entities = entities or []
ndb.get_context().set_cache_policy(lambda key: key.kind() not in 
entities)

def __init__(self, db, uri='google:sql://realm:domain/database',
 pool_size=0, folder=None, db_codec='UTF-8',
 credential_decoder=IDENTITY, driver_args={},
 adapter_args={}, do_connect=True, after_connection=None):

self.db = db
self.dbengine = "mysql"
self.uri = uri
self.pool_size = pool_size
self.db_codec = db_codec
self._after_connection = after_connection
if do_connect: self.find_driver(adapter_args, uri)
self.folder = folder or pjoin('$HOME',THREAD_LOCAL.folder.split(
os.sep+'applications'+os.sep,1)[1])
ruri = uri.split("://")[1]
m = self.REGEX_URI.match(ruri)
if not m:
raise SyntaxError("Invalid URI string in SQLDB: %s" % self.uri)
instance = credential_decoder(m.group('instance'))
self.dbstring = db = credential_decoder(m.group('db'))
driver_args['instance'] = instance

*#KK's addition to attempt fix 2nd gen problem with missing user 
name and password:*
*driver_args['user'] = os.environ.get('CLOUDSQL_USER')*
*driver_args['password'] = os.environ.get('CLOUDSQL_PASSWORD')*

if not 'charset' in driver_args:
driver_args['charset'] = 'utf8'
self.createdb = createdb = adapter_args.get('createdb',True)
if not createdb:
driver_args['database'] = db

*#KK added this for debug:*
*print "DEBUG: driver args = " + str(driver_args) *   

def connector(driver_args=driver_args):
return rdbms.connect(**driver_args)
self.connector = connector
if do_connect: self.reconnect()

-- 
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 change menu bar background and font colors

2017-04-26 Thread Karoly Kantor
I am a little embarrassed to ask this, but I've been trying to do this for 
hours now... I find outdated info only in various posts.

So, how exactly do I change the menu bar background and font colors?

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


[web2py] Is web2py incompatible with 2nd generation Google Cloud SQL ?

2017-04-24 Thread Karoly Kantor
Dear Sirs,

I can connect my Google App Engine web2p app to a first generation GAE SQL 
instance, but not to a second generation one. I was talking to a cloud SQL 
support person on another forum and he said, I quote:

"Your first generation CloudSQL instance has the app name as an authorized 
user, the second generation doesn’t. Your logs show connection errors to 
the instance from a user without password. "

So my question is: Where do I set a database user name and password in 
web2p to connect to a 2nd Gen Google SQL instance, if it is possible at 
all? I see this option with other connection strings in the doc, but not 
for Google.

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: Google SQL Database user and password - where to set?

2017-04-24 Thread Karoly Kantor
More info: This in the log:

DEBUG: connect attempt 4, connection error: Traceback (most recent call 
last): File 
"/base/data/home/apps/e~unidb-project/2.400786701713097994/gluon/packages/dal/pydal/base.py",
 
line 446 
,
 
in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File 
"/base/data/home/apps/e~unidb-project/2.400786701713097994/gluon/packages/dal/pydal/adapters/base.py",
 
line 60 
,
 
in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File 
"/base/data/home/apps/e~unidb-project/2.400786701713097994/gluon/packages/dal/pydal/adapters/google_adapters.py",
 
line 59 
,
 
in __init__ if do_connect: self.reconnect() File 
"/base/data/home/apps/e~unidb-project/2.400786701713097994/gluon/packages/dal/pydal/connection.py",
 
line 104 
,
 
in reconnect self.connection = f() File 
"/base/data/home/apps/e~unidb-project/2.400786701713097994/gluon/packages/dal/pydal/adapters/google_adapters.py",
 
line 57 
,
 
in connector return rdbms.connect(**driver_args) File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/rdbms.py",
 
line 70, in connect password=password) File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
 
line 813, in __init__ self.OpenConnection() File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
 
line 836, in OpenConnection response = self.MakeRequest('OpenConnection', 
request) File 
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
 
line 947, in MakeRequest raise _ToDbApiException(response.sql_exception) 
InternalError: (0, u'Not authorized to access instance: 
my-project:europe-west1:sql-instance-1') 

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


[web2py] Re: GAE Datastore performance / potential index issue

2017-04-24 Thread Karoly Kantor
More info again, still hoping someone can help:

I tried to replace the DAL query with native app engine code.

Original DAL:

query=(
(mydb[record].application == application_id) &
(mydb[record].entity == entity_id) &
(mydb[record].is_deleted == False))

result = mydb(query).select()

Native:

 from google.appengine.ext import ndb
class record(ndb.Expando):
pass
result = 
record.query().filter(ndb.GenericProperty('application') == application_id, 
ndb.GenericProperty('entity') == entity.id, 
ndb.GenericProperty('is_deleted') == False)
 
I was hoping this will speed things up, but it did not. It was the same 
slowness on the local dev env. On the server, the situation became even 
worse:

"While handling this request, the process that handled this request was 
found to be using too much memory and was terminated. "

Anyway, I still find it unreal that a query of 800 rows can last more than 
20 seconds. 

Ideas are continue to be most welcome.
  

-- 
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: GAE Datastore performance / potential index issue

2017-04-24 Thread Karoly Kantor
Sorry for commenting on my own issue, but i have more information:

The following query takes 20 seconds for only 800 items:

query=(
(mydb[record].application == application_id) &
(mydb[record].entity == entity_id) &
(mydb[record].is_deleted == False))

result = db(query).select()

I don't think this is normal. I really would like to know what web2py might 
be really doing in terms of raw GAE query, but unfortunately _lastsql still 
does not give any info.

Any idea / insight would be greatly appreciated!

The index seems to exist and serve in GAE Datastore as follows:

 record  application 
 entity 
 is_deleted 


-- 
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] Google SQL Database user and password - where to set?

2017-04-22 Thread Karoly Kantor
A very simple question:
I am trying to move to Google Cloud SQL.
I created an SQL instance with Google, where I had to set a data base user 
name and password.
Where do i set that in my web2py app?

(Currently i have this in app.yaml, as prescribed by the Google Cloud 
Website:

env_variables:
CLOUDSQL_CONNECTION_NAME: 
unidb-project:europe-west1:unidb-sql-instance-1
CLOUDSQL_USER: root
CLOUDSQL_PASSWORD: pw

but i get refused by the SQL instance.)

-- 
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] GAE Datastore performance / potential index issue

2017-04-22 Thread Karoly Kantor
My queries on GAE Datastore are very slow. So I decided to try to fetch 
everything into memory before further processing, to no avail.

For example, the following runs for 8 seconds for only 3000 items, which is 
very bad because my app might have much much  more than that eventually.

query = (db.record_text.entity == entity.id)
result = db(query).select(db.record_text.ALL)
values['record_text'] = {}
for r in result:
values['record_text'][str(r.record)] = {}
values['record_text'][str(r.record)][str(r.field)] = r.value

I am suspecting maybe there is a problem with my indexes.

Questions: 

1. When I do the query as described above, what fields is web2py really 
querying on, i.e. what indexes should I have?
2. I there maybe some index required due to auth.signature being ON?

Or maybe the problem is not related to index, any other suggestion would be 
welcome.


-- 
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] web2py and python future version strategy

2017-04-14 Thread Karoly Kantor
I know this has been discussed before, but I really would like to have an 
up-to-date perspective on this.

I am currently developing an application in python 2.7, web2py 2.14.6 on 
Google App Engine, that I plan to release for commercial use in September, 
2017.

My short question is: should I stick to my current python and web2py or 
should I switch to something newer now?

Reasons behind the question:
- I understand python 2.7 will come to an "end of life", and python 3 is 
not fully compatible
- GAE now supports python 3
- I am not sure web2py is python 3 compatible, or it ever will be?
- I understand there is work on a "web3py", which might also not be 
backwards compatible (?)
I would rather make a switch right now, if necessary, rather than after my 
commercial golive.

I would like to have an overall strategy on this, to see what's ahead in 
the next few years. Any insights would be greatly appreciated.

Greetings to all from Budapest, on a very nice sunny Good Friday :-)

-- 
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] How do i make a field NOT required when using IS_IN_SET() ?

2017-04-10 Thread Karoly Kantor
Thank you, it works, you saved me the time for lunch :-)

On Monday, April 10, 2017 at 2:14:12 PM UTC+2, Marvix wrote:
>
> tried this?
> requires=IS_EMPTY_OR(IS_IN_SET(...))
>
> 2017-04-10 14:07 GMT+02:00 Karoly Kantor >:
>
>> I have a picklist type of field where the user selects from a set of 
>> predefined values. I am using IS_IN_SET(list_of_values) in the Field 
>> constructor.
>> The form cannot be saved unless a value is selected, i.e. the field is 
>> essentially a required field.
>>
>> I would like to allow the user NOT to select a value, and still be able 
>> to save the form.
>>
>> -- 
>> 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] How do i make a field NOT required when using IS_IN_SET() ?

2017-04-10 Thread Karoly Kantor
I have a picklist type of field where the user selects from a set of 
predefined values. I am using IS_IN_SET(list_of_values) in the Field 
constructor.
The form cannot be saved unless a value is selected, i.e. the field is 
essentially a required field.

I would like to allow the user NOT to select a value, and still be able to 
save the form.

-- 
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: Password Recovery Not Sending (lazyT object being passed to GAE?)

2017-04-06 Thread Karoly Kantor
Thanks, this helped, i am now using my own function to send the password 
reset email.

On Friday, March 31, 2017 at 2:51:03 PM UTC+2, Jacinto Parga wrote:
>
> Yes, still unresolved.
>
> I did a workaround for the request_reset_password: 
>
> def user(): 
> if request.args(0)=='request_reset_password':
> redirect(URL('default','myrequestpass'))
> return dict(form=auth())
>
> def myrequestpass():
> form = SQLFORM.factory(
> Field('u_email', requires =[IS_EMAIL(error_message='Wrong email'), 
> IS_IN_DB(db, 'auth_user.email', error_message='Address not in DB')]),
>   table_name='solicitar_pass')
> if form.process().accepted:
> user = db(db.auth_user.email==form.vars.u_email).select().first()
> session.flash = 'Comprueba tu correo '+str(user.first_name)
> u_passwd = str(hex(int(time.time([2:]
> user.update_record(password=CRYPT()(u_passwd.encode('utf8'))[0])
> mensaje=' Retrieve your password Temporal password 
> :  '+ u_passwd   +'   Login with the temporal password 
> and set your new password in this link :https://yoursite.com/user/login?_next=/user/change_password";>Change 
> Password''
> mail.send(to=[form.vars.u_email],
> subject='Change your password, follow this link',
> message=mensaje)
> redirect(URL('default','index'))
> elif form.errors:
>     response.flash = 'Wrong Email address'
> return dict(form=form)
>
>
> But anyway the lazyT found is an annoying error width, for instance: auth.
> settings.auth_two_factor_enabled = True
>
>
> El jueves, 30 de marzo de 2017, 8:13:06 (UTC+2), Karoly Kantor escribió:
>>
>> As the issue is still unresolved, i have unchecked the "no action needed" 
>> flag on this topic. Any help would be appreciated. Thank you.
>>
>> On Thursday, March 30, 2017 at 6:33:07 AM UTC+2, Karoly Kantor wrote:
>>>
>>> This issue still seems to be unsolved. I have a fresh installation on 
>>> GAE, reset password emails fail due to "need string or buffer, lazyT 
>>> found"
>>>
>>> Is there something I can do?
>>>
>>> Thanks.
>>>
>>> On Friday, July 29, 2016 at 7:49:14 AM UTC+2, webm...@trytha.com wrote:
>>>>
>>>> I just uploaded an updated version of web2py to my server, replacing a 
>>>> much older version (likely 2.12.2), and now it won't send password 
>>>> recovery 
>>>> emails.  The error in the logs is: 
>>>>
>>>> Mail.send failure:coercing to Unicode: need string or buffer, lazyT 
>>>> found
>>>>
>>>> This suggests to me that somehow a string is not properly being passed. 
>>>>  I gather that lazyT has something to do with the built-in translation 
>>>> capabilities of web2py?  Probably don't need to be translating email 
>>>> addresses (though I guess it could be trying to translate the recovery 
>>>> message).  Either way, GAE wants nothing to do with it.
>>>>
>>>> How can I fix this?
>>>>
>>>

-- 
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] GAE Datastore conceptual question - different fields in different rows of a table

2017-04-05 Thread Karoly Kantor
In GAE Datastore I can put any arbitrary properties into an entity of an 
entity kind (in SQL terms, I can put any field into a table row), without 
having to redefine / migrate the table. This GAE datastore feature is very 
useful for my specific purposes.

Is there a way I can make use of this GAE Datastore possibility thru web2py 
DAL? How? Or, do I have to do directly to GAE, circumventing DAL?

More specifically, if i had GAE datastore entities of an entity kind that 
have different properties, could I still somehow use the following web2py 
features:

- DAL query, insert, update,
- SQLFORM?




-- 
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: Password Recovery Not Sending (lazyT object being passed to GAE?)

2017-03-31 Thread Karoly Kantor
Thanks very much, Jacinto. I will try and report back.

I still consider this significant issue, this is something that probably 
impacts everyone on GAE, and not only under some special and rare 
circumstances. I am hoping it will be eventually resolved in the core 
web2py code.

On Friday, March 31, 2017 at 2:51:03 PM UTC+2, Jacinto Parga wrote:
>
> Yes, still unresolved.
>
> I did a workaround for the request_reset_password: 
>
> def user(): 
> if request.args(0)=='request_reset_password':
> redirect(URL('default','myrequestpass'))
> return dict(form=auth())
>
> def myrequestpass():
> form = SQLFORM.factory(
> Field('u_email', requires =[IS_EMAIL(error_message='Wrong email'), 
> IS_IN_DB(db, 'auth_user.email', error_message='Address not in DB')]),
>   table_name='solicitar_pass')
> if form.process().accepted:
> user = db(db.auth_user.email==form.vars.u_email).select().first()
> session.flash = 'Comprueba tu correo '+str(user.first_name)
> u_passwd = str(hex(int(time.time([2:]
> user.update_record(password=CRYPT()(u_passwd.encode('utf8'))[0])
> mensaje=' Retrieve your password Temporal password 
> :  '+ u_passwd   +'   Login with the temporal password 
> and set your new password in this link :https://yoursite.com/user/login?_next=/user/change_password";>Change 
> Password''
> mail.send(to=[form.vars.u_email],
> subject='Change your password, follow this link',
> message=mensaje)
> redirect(URL('default','index'))
> elif form.errors:
>     response.flash = 'Wrong Email address'
> return dict(form=form)
>
>
> But anyway the lazyT found is an annoying error width, for instance: auth.
> settings.auth_two_factor_enabled = True
>
>
> El jueves, 30 de marzo de 2017, 8:13:06 (UTC+2), Karoly Kantor escribió:
>>
>> As the issue is still unresolved, i have unchecked the "no action needed" 
>> flag on this topic. Any help would be appreciated. Thank you.
>>
>> On Thursday, March 30, 2017 at 6:33:07 AM UTC+2, Karoly Kantor wrote:
>>>
>>> This issue still seems to be unsolved. I have a fresh installation on 
>>> GAE, reset password emails fail due to "need string or buffer, lazyT 
>>> found"
>>>
>>> Is there something I can do?
>>>
>>> Thanks.
>>>
>>> On Friday, July 29, 2016 at 7:49:14 AM UTC+2, webm...@trytha.com wrote:
>>>>
>>>> I just uploaded an updated version of web2py to my server, replacing a 
>>>> much older version (likely 2.12.2), and now it won't send password 
>>>> recovery 
>>>> emails.  The error in the logs is: 
>>>>
>>>> Mail.send failure:coercing to Unicode: need string or buffer, lazyT 
>>>> found
>>>>
>>>> This suggests to me that somehow a string is not properly being passed. 
>>>>  I gather that lazyT has something to do with the built-in translation 
>>>> capabilities of web2py?  Probably don't need to be translating email 
>>>> addresses (though I guess it could be trying to translate the recovery 
>>>> message).  Either way, GAE wants nothing to do with it.
>>>>
>>>> How can I fix this?
>>>>
>>>

-- 
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: Password Recovery Not Sending (lazyT object being passed to GAE?)

2017-03-29 Thread Karoly Kantor
As the issue is still unresolved, i have unchecked the "no action needed" 
flag on this topic. Any help would be appreciated. Thank you.

On Thursday, March 30, 2017 at 6:33:07 AM UTC+2, Karoly Kantor wrote:
>
> This issue still seems to be unsolved. I have a fresh installation on GAE, 
> reset password emails fail due to "need string or buffer, lazyT found"
>
> Is there something I can do?
>
> Thanks.
>
> On Friday, July 29, 2016 at 7:49:14 AM UTC+2, webm...@trytha.com wrote:
>>
>> I just uploaded an updated version of web2py to my server, replacing a 
>> much older version (likely 2.12.2), and now it won't send password recovery 
>> emails.  The error in the logs is: 
>>
>> Mail.send failure:coercing to Unicode: need string or buffer, lazyT found
>>
>> This suggests to me that somehow a string is not properly being passed. 
>>  I gather that lazyT has something to do with the built-in translation 
>> capabilities of web2py?  Probably don't need to be translating email 
>> addresses (though I guess it could be trying to translate the recovery 
>> message).  Either way, GAE wants nothing to do with it.
>>
>> How can I fix this?
>>
>

-- 
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: We do not delete posts

2017-03-29 Thread Karoly Kantor
Me too. :-)

On Monday, March 20, 2017 at 2:42:16 PM UTC+1, ross mclean wrote:
>
> I've made 2 post put neither appear to have been published, assuming this 
> is due to me being a new member. If possible please could one of the 
> moderators review and approve. Ross
>
> On Monday, July 20, 2015 at 9:08:57 AM UTC+1, Massimo Di Pierro wrote:
>>
>> We never delete posts from users, unless the users ask (because they 
>> accidentally post the server password, for example). Yet first posts are 
>> moderated to avoid spam. Usually when a post is on hold for moderation it 
>> is approved within 24 hours or less.
>>
>> There are some glitches in the process. 
>> - Occasionally some posts have disappeared on their own. We attributed 
>> this to a Google glitch. It has not happened recently. 
>> - Some times Google requires moderation even for posts from people that 
>> have been whitelisted. This is not our policy and we do not know why it 
>> happens, but it does. 
>> - Some posts have erroneously been flagged as spam by moderators. We can 
>> fix this.
>> - Some times it takes longer then 24 hrs for a post to be moderated, but 
>> never more than 48 hrs.
>> These problems are very very rare.
>>
>> If your first post does not show up, then it is moderated. Just wait. Do 
>> not post 10 more copies of it. That just calls for trouble and more work 
>> for all of us. If your post does not show up in 24 hours, email me 
>> personally and I will take a look.
>>
>> We could use some more moderators, so feel free to volunteer by emailing 
>> me.
>>
>> Fun fact: 90% of spam posts are job announcements about Java.
>>
>> Massimo
>>
>>
>>

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


[web2py] Re: Password Recovery Not Sending (lazyT object being passed to GAE?)

2017-03-29 Thread Karoly Kantor
This issue still seems to be unsolved. I have a fresh installation on GAE, 
reset password emails fail due to "need string or buffer, lazyT found"

Is there something I can do?

Thanks.

On Friday, July 29, 2016 at 7:49:14 AM UTC+2, webm...@trytha.com wrote:
>
> I just uploaded an updated version of web2py to my server, replacing a 
> much older version (likely 2.12.2), and now it won't send password recovery 
> emails.  The error in the logs is: 
>
> Mail.send failure:coercing to Unicode: need string or buffer, lazyT found
>
> This suggests to me that somehow a string is not properly being passed.  I 
> gather that lazyT has something to do with the built-in translation 
> capabilities of web2py?  Probably don't need to be translating email 
> addresses (though I guess it could be trying to translate the recovery 
> message).  Either way, GAE wants nothing to do with it.
>
> How can I fix this?
>

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