[web2py] DAL counts / groupby

2015-11-12 Thread Jason Solack
Hello everyone,

I have a few tables structured like this:

db.define_table('question_table',
Field('qid'),
Field('display_text'),
)

db.define_table('answer_table',
Field('qid'),
Field('value'),
Field('display_text'),
)

db.define_table('data',
Field('qid'),
Field('value')
)

What I am doing is getting all unique values from the data table, getting 
the display_text from the answer_table and displaying a table of the 
display_text and how many times it was present in the data table.

here's my functioning code

results = []
for row in db(db.data.qid == qid).select(db.data.value, distinct=True):
results.append([db((db.answer_table.value == row.value) & 
(db.answer_table.qid == qid)).select().first().display_text, 
db((db.data.qid == qid) & (db.data.value == row.value)).count()])

i'm hoping there's some way to get this in a more straightforward fashion, 
or in a way that would optimize performance.

Thank you for the help you can give!

Jason

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


[web2py] Re: Creating web apps with Web2py in Azure Web Apps

2015-11-12 Thread Niphlod
+1 +1 +1 +1 
this should go in web2pyslices.com (although the venv machinery is not 
strictly necessary, it's a "nice to have")

On Thursday, November 12, 2015 at 10:09:36 PM UTC+1, Nbush wrote:
>
> Hi all,
>
> just want to share web2py setup Azure Web Apps.
>
> Based on 
> https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/
>
> 1. Create web app on Azure Portal
> 2. Fork a repo web2py (github)
> 3.* Add 4 files  to own github repository (web2py/)*
> 4. Configure continuous deployment using github 
> https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
>  
> look *Deploy files from a repository site like BitBucket, CodePlex, 
> Dropbox, GitHub, or Mercurial. *
>
>> *Azure creates an association with the selected repository, and pulls in 
>> the files from the specified branch. After this process completes, the 
>> Deployment section of your web app's blade will show an Active Deployment 
>> message that indicates deployment has succeeded.*
>
> 5. Run web app on on Azure Portal
>
> Admin password:
> 1.on local copy web2py - save the password in the parameters_8000.py file
> 2.rename parameters_8000.py parameters_443.py
> 3.copy parameters_443.py via FTP (link in Azure Portal) in site/wwwroot
>
> Example: 
> https://nbush2py.azurewebsites.net
> https://github.com/Nbushkov/web2py
>
>
>

-- 
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: securing download function

2015-11-12 Thread Anthony
Assuming db.foo has a field called "auth_user" that is a reference to the 
db.auth_user table and includes the ID of the user that owns the file, then 
your pseudo-code is also the actual code.

Alternatively, you could use the Auth permissions functionality, which 
would involve assigning a permission for the user (technically, the user's 
unique Auth group) to be able to access a particular record. But for this 
simple case, your current approach is probably easier.

Anthony

On Thursday, November 12, 2015 at 2:25:13 PM UTC-5, Mark Billion wrote:
>
> Im not sure if this is necessary/redundant, but here is my question:
>
> Is there any way to check permission for the download -- i.e.,  the client 
> associated with the file is checked and confirmed prior to the initiation 
> of the dl without having to pass extra vars -- i.e., just using the 
> filename that is passed as an argument?
>
> db.define_table('foo',
> Field('client', ...),
> Field('file', ...),
> Field('auth_user', ...),
> )
>
>
> def download():
> *In pseudocode:*
> *q = db(db.foo.file == [filename]).select().last()*
> *if q.auth_user != auth.user.id :*
> *  redirect/fail*
> """
> allows downloading of uploaded files
> http:///[app]/default/download/[filename]
> """
> return response.download(request, db)
>
>

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

2015-11-12 Thread Niphlod
It's backend's job to know if it's "better" to use the index or to proceed 
as normal. It's normally referred as "query optimizer stage".

In SOME backends you can issue rather specific sql "hints" to "optimize 
yourself" (if you think you're smarter than your backend) the query, but 
being that specific it's impossible to abstract those hints in a DAL 
helper. You'd have to read your backend documentation and write the query 
by hand.

BTW: I'm a DBA and I'm quite sure that less than 1 person on a thousand is 
smarter than a backend like postgresql, oracle or mssql, and that 
"smartness" is actually valid on a total of 1 query on 10k.

tl;dr : let the backend argue about using or not the index.

On Thursday, November 12, 2015 at 8:05:54 PM UTC+1, Fabiano Almeida wrote:
>
> Hi All!
>
> In book 
> 
>  
> I see example how to create index with executesql . How to use indexes in 
> querys?
>
> Thx,
>
> Fabiano.
>

-- 
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 on Microsoft Azure PAAS

2015-11-12 Thread Nbush
https://groups.google.com/forum/#!topic/web2py/XGxM_Tb9nJ4

вторник, 10 февраля 2015 г., 15:03:15 UTC+3 пользователь Gary Cowell 
написал:
>
> Anyone any experience on deploying a web2py app on Microsoft Azure Web?
>
> Can it be done?
>

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

2015-11-12 Thread p a
In case your question was more basic: you define indices, then just issue 
sql commands normally, and the database will benefit from the existence of 
the indices (many queries will run faster if the indices are there, but no 
modification is needed of the query itself).

BTW, I didn't know you could tell the database how to do its job!

-- 
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: securing download function

2015-11-12 Thread Niphlod
what are you afraid of ?

On Thursday, November 12, 2015 at 8:25:13 PM UTC+1, Mark Billion wrote:
>
> Im not sure if this is necessary/redundant, but here is my question:
>
> Is there any way to check permission for the download -- i.e.,  the client 
> associated with the file is checked and confirmed prior to the initiation 
> of the dl without having to pass extra vars -- i.e., just using the 
> filename that is passed as an argument?
>
> db.define_table('foo',
> Field('client', ...),
> Field('file', ...),
> Field('auth_user', ...),
> )
>
>
> def download():
> *In pseudocode:*
> *q = db(db.foo.file == [filename]).select().last()*
> *if q.auth_user != auth.user.id :*
> *  redirect/fail*
> """
> allows downloading of uploaded files
> http:///[app]/default/download/[filename]
> """
> return response.download(request, db)
>
>

-- 
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] Creating web apps with Web2py in Azure Web Apps

2015-11-12 Thread Nbush
Hi all,

just want to share web2py setup Azure Web Apps.

Based 
on 
https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/

1. Create web app on Azure Portal
2. Fork a repo web2py (github)
3.* Add 4 files  to own github repository (web2py/)*
4. Configure continuous deployment using 
github 
https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
 
look *Deploy files from a repository site like BitBucket, CodePlex, 
Dropbox, GitHub, or Mercurial. *

> *Azure creates an association with the selected repository, and pulls in 
> the files from the specified branch. After this process completes, the 
> Deployment section of your web app's blade will show an Active Deployment 
> message that indicates deployment has succeeded.*

5. Run web app on on Azure Portal

Admin password:
1.on local copy web2py - save the password in the parameters_8000.py file
2.rename parameters_8000.py parameters_443.py
3.copy parameters_443.py via FTP (link in Azure Portal) in site/wwwroot

Example: 
https://nbush2py.azurewebsites.net
https://github.com/Nbushkov/web2py


-- 
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.
 # 
 #
 # Copyright (c) Microsoft Corporation. 
 #
 # This source code is subject to terms and conditions of the Apache License, Version 2.0. A 
 # copy of the license can be found in the License.html file at the root of this distribution. If 
 # you cannot locate the Apache License, Version 2.0, please send an email to 
 # vspyt...@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 # by the terms of the Apache License, Version 2.0.
 #
 # You must not remove this notice, or any other, from this software.
 #
 # ###

import datetime
import os
import sys
import traceback

if sys.version_info[0] == 3:
def to_str(value):
return value.decode(sys.getfilesystemencoding())

def execfile(path, global_dict):
"""Execute a file"""
with open(path, 'r') as f:
code = f.read()
code = code.replace('\r\n', '\n') + '\n'
exec(code, global_dict)
else:
def to_str(value):
return value.encode(sys.getfilesystemencoding())

def log(txt):
"""Logs fatal errors to a log file if WSGI_LOG env var is defined"""
log_file = os.environ.get('WSGI_LOG')
if log_file:
f = open(log_file, 'a+')
try:
f.write('%s: %s' % (datetime.datetime.now(), txt))
finally:
f.close()

ptvsd_secret = os.getenv('WSGI_PTVSD_SECRET')
if ptvsd_secret:
log('Enabling ptvsd ...\n')
try:
import ptvsd
try:
ptvsd.enable_attach(ptvsd_secret)
log('ptvsd enabled.\n')
except: 
log('ptvsd.enable_attach failed\n')
except ImportError:
log('error importing ptvsd.\n');

def get_wsgi_handler(handler_name):
if not handler_name:
raise Exception('WSGI_ALT_VIRTUALENV_HANDLER env var must be set')

if not isinstance(handler_name, str):
handler_name = to_str(handler_name)

module_name, _, callable_name = handler_name.rpartition('.')
should_call = callable_name.endswith('()')
callable_name = callable_name[:-2] if should_call else callable_name
name_list = [(callable_name, should_call)]
handler = None
last_tb = ''

while module_name:
try:
handler = __import__(module_name, fromlist=[name_list[0][0]])
last_tb = ''
for name, should_call in name_list:
handler = getattr(handler, name)
if should_call:
handler = handler()
break
except ImportError:
module_name, _, callable_name = module_name.rpartition('.')
should_call = callable_name.endswith('()')
callable_name = callable_name[:-2] if should_call else callable_name
name_list.insert(0, (callable_name, should_call))
handler = None
last_tb = ': ' + traceback.format_exc()

if handler is None:
raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))

return handler

activate_this = os.getenv('WSGI_ALT_VIRTUALENV_ACTIVATE_THIS')
if not activate_this:
raise Exception('WSGI_ALT_VIRTUALENV_ACTIVATE_THIS is not set')

def get_virtualenv_handler():
log('Activating virtualenv with %s\n' % activate_this)

[web2py] Re: invalid field value

2015-11-12 Thread Pierre
thanks a lot Anthony
you solved the "problem"

web2py +++ as usual

Le jeudi 12 novembre 2015 00:53:30 UTC+1, Anthony a écrit :
>
> On Wednesday, November 11, 2015 at 4:40:17 PM UTC-5, Pierre wrote:
>>
>> items = db().select(db.c_sub.ALL)
>> form = SQLFORM.factory(*[Field(item.name, type='boolean', 
>> default=False, comment=item.c_main.name) for item in items])
>>
>
> The IS_SLUG validation of values you are inserting into the db.c_sub table 
> is working as expected. The problem is that you are attempting to create a 
> form where the slug values become the names of the form fields. When using 
> SQLFORM.factory to create a form, you must use the Field() constructor, but 
> the "name" argument of Field() must be a valid Python identifier (so, 
> hyphens are not allowed).
>
> If you are OK with using underscores in place of hyphens, you could do 
> something like:
>
> Field(item.name.replace('-', '_'), label=item.name, ...)
>
> That will display the item.name as the label on the form but replace 
> hyphens with underscores in the actual input element names. Alternatively, 
> you could drop the "label" argument, in which case you'll get the default 
> labels, which replace the underscores with spaces.
>
> Alternatively, you could store the slugs themselves with underscores 
> rather than hyphens, either by implementing a custom validator or using 
> something like:
>
> Field('name', requires=[CLEANUP(r'-'), IS_SLUG(check=True, 
> keep_underscores=True), IS_LOWER()])
>
> Note, the above will allow submitted values with hyphens, but it will 
> remove the hyphens. It will then check to make sure the string includes no 
> special characters except underscores.
>
> Finally, you could use the FORM helper instead of SQLFORM.factory to 
> generate the form, as that will allow any names you want for the INPUT 
> elements.
>
> 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] scheduler problem: stressed worker stops working

2015-11-12 Thread Manuele Pesenti
Hi!
I have developed a web application using web2py with the aim of
configuring little single boards so I thought to use the web interface
to set up variables and configuration files and the scheduler, that run
with root privileges, to apply configurations.

The problem is that to have near real time performances I set up a
really hight heartbeat (0.3 seconds) and each time the user apply the
configuration a task is queued with immediate parameter set to True.

Now sometime happens that the scheduler worker stops to make their job
and does not take charge of tasks no more.
Trying to understand what happend I found that the worker in their
worker_stats is still configured as "running" even if ended up the last
task with success.

The only way to come out from theese kind of situations is to restart
the scheduler daemon or reset the worker removing the record in the db
table and let the scheduler to create a brand new worker record.

Does anybody had similar experiences or have any suggestions?
Any idea how to automatically stress the scheduler in order to
understand their performances limit?

Thank you very mutch
Cheers

Manuele

-- 
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: TypeError: an integer is required

2015-11-12 Thread Massimo Di Pierro
Is this the best mailing list ever for web app developers?

On Wednesday, 11 November 2015 12:59:55 UTC-6, Anthony Smith wrote:
>
> Thanks Anthony, you guys are a great assistance to all the newbies 
>
> cheers
>
> On Wednesday, 11 November 2015 23:30:54 UTC+11, Anthony wrote:
>>
>> datetime.date() is for constructing a date object and it takes integer 
>> arguments (for the year, month, and day) -- you don't pass a date to it. 
>> Instead, just do:
>>
>> SPAN(v, ...)
>>
>> Or if you don't like the default format you get when the date is 
>> converted to a string, use the .strftime method:
>>
>> SPAN(v.strftime('%m/%d/%Y'))
>>
>> Anthony
>>
>> On Wednesday, November 11, 2015 at 2:09:04 AM UTC-5, Anthony Smith wrote:
>>>
>>> Hi, 
>>> I am using the follow to highlight a date field where the date is 
>>> greater then the current date.
>>>
>>> db.stock_task.ESI_withhold_until_date.represent = lambda v,row: 
>>> SPAN(datetime.date(v),_class='withhold' if v >datetime.date.today() else 
>>> None)
>>> db.stock_task.ESI_withhold_until_date.represent = lambda v,row: 
>>> SPAN(datetime.date(v),_class='withhold' if v and v> datetime.date.today() 
>>> else None)
>>>
>>> Traceback (most recent call last):
>>>   File "/home/tony/web2py/gluon/restricted.py", line 227, in restricted
>>> exec ccode in environment
>>>   File "/home/tony/web2py/applications/cps5c/controllers/default.py" 
>>> , 
>>> line 562, in 
>>>   File "applications/cps5c/modules/plugin_sqleditable/editable.py", line 
>>> 415, in extract
>>> r=func()
>>>   File "/home/tony/web2py/gluon/tools.py", line 3774, in f
>>> return action(*a, **b)
>>>   File "/home/tony/web2py/applications/cps5c/controllers/default.py" 
>>> , 
>>> line 268, in stock_tasks
>>> db.stock_task.created_by,
>>>   File "/home/tony/web2py/gluon/sqlhtml.py", line 2717, in grid
>>> nvalue = field.represent(value, row)
>>>   File "/home/tony/web2py/applications/cps5c/models/db1.py" 
>>> , line 144, 
>>> in 
>>> db.stock_task.ESI_withhold_until_date.represent = lambda v,row: 
>>> SPAN(datetime.date (v),_class='withhold' if v > datetime.date.today() else 
>>> None)
>>> TypeError: an integer is required
>>>
>>>
>>> if I use the following works fine.
>>> db.stock_task.withhold_until_date.represent = lambda v, row: 
>>> SPAN(prettydate(v),_class='withhold' if v and v>datetime.date.today() else 
>>> None)
>>>
>>> any help appreciated
>>>
>>> cheers
>>>
>>

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


[web2py] Re: Creating web apps with Web2py in Azure Web Apps

2015-11-12 Thread Massimo Di Pierro
I do not know how long web2py slices will live. Bruno does not want to 
maintain it and GoDaddy is adopting their usual policy of not allowing the 
domain transfer (they say yes but it does not work). We need a better 
solution. Would you opposed to a scripts/azure/ subfolder?

On Thursday, 12 November 2015 15:49:52 UTC-6, Niphlod wrote:
>
> +1 +1 +1 +1 
> this should go in web2pyslices.com (although the venv machinery is not 
> strictly necessary, it's a "nice to have")
>
> On Thursday, November 12, 2015 at 10:09:36 PM UTC+1, Nbush wrote:
>>
>> Hi all,
>>
>> just want to share web2py setup Azure Web Apps.
>>
>> Based on 
>> https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/
>>
>> 1. Create web app on Azure Portal
>> 2. Fork a repo web2py (github)
>> 3.* Add 4 files  to own github repository (web2py/)*
>> 4. Configure continuous deployment using github 
>> https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
>>  
>> look *Deploy files from a repository site like BitBucket, CodePlex, 
>> Dropbox, GitHub, or Mercurial. *
>>
>>> *Azure creates an association with the selected repository, and pulls in 
>>> the files from the specified branch. After this process completes, the 
>>> Deployment section of your web app's blade will show an Active Deployment 
>>> message that indicates deployment has succeeded.*
>>
>> 5. Run web app on on Azure Portal
>>
>> Admin password:
>> 1.on local copy web2py - save the password in the parameters_8000.py file
>> 2.rename parameters_8000.py parameters_443.py
>> 3.copy parameters_443.py via FTP (link in Azure Portal) in site/wwwroot
>>
>> Example: 
>> https://nbush2py.azurewebsites.net
>> https://github.com/Nbushkov/web2py
>>
>>
>>

-- 
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: Scheduler - Worker node heartbeats stop randomly

2015-11-12 Thread Gary Cowell
I use supervisord because it brings the configuration of daemon services 
within a consistent configuration.

I can write one supervisord.conf, and so long as the supervisor is 
installed in any given distro, I can run my services. 

No need to then worry about upstart vs systemd vs SysV init vs ... whatever.

Plus, supervisor plays nice with python.

On Friday, 6 November 2015 13:47:07 UTC, Niphlod wrote:
>
> workers "check in" every heartbeat seconds. You can enable all sorts of 
> logs to trace the exact second they died.
>
> That being said, there's no way for a died process to check if it's alive. 
> That's why EVERY "daemon" should be handled by each platform's "daemon" 
> system (or a process specifically made for it): in windows it's nssm, on 
> unix it can be upstart or systemd, or a 3rd party solution like supervisord.
>
> On Friday, November 6, 2015 at 2:20:43 AM UTC+1, Benson Myrtil wrote:
>>
>> Good morning,
>>
>> I am sure this is a noob question but I cant seem to find a solid answer. 
>> I have started a worker nodes using the 'python web2py.py -K [app]' 
>> command. Everything appears to work fine for a while. My scheduled task 
>> need to run once a day but I am noticing that the worker node randomly 
>> 'dies' after a couple of hours.
>>
>> Is there some setting I am missing to prevent the worker nodes from dying 
>> even if they are idle for several hours?
>>
>

-- 
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: scheduler problem: stressed worker stops working

2015-11-12 Thread Niphlod
 scheduler is NOT meant for realtime operations (yep, I said it). You'd 
better off configuring a little script (bottle?!) ran with root and 
listening to another port.

On Thursday, November 12, 2015 at 9:05:03 AM UTC+1, Manuele wrote:
>
> Hi! 
> I have developed a web application using web2py with the aim of 
> configuring little single boards so I thought to use the web interface 
> to set up variables and configuration files and the scheduler, that run 
> with root privileges, to apply configurations. 
>
> The problem is that to have near real time performances I set up a 
> really hight heartbeat (0.3 seconds) and each time the user apply the 
> configuration a task is queued with immediate parameter set to True. 
>
> Now sometime happens that the scheduler worker stops to make their job 
> and does not take charge of tasks no more. 
> Trying to understand what happend I found that the worker in their 
> worker_stats is still configured as "running" even if ended up the last 
> task with success. 
>
> The only way to come out from theese kind of situations is to restart 
> the scheduler daemon or reset the worker removing the record in the db 
> table and let the scheduler to create a brand new worker record. 
>
> Does anybody had similar experiences or have any suggestions? 
> Any idea how to automatically stress the scheduler in order to 
> understand their performances limit? 
>
> Thank you very mutch 
> Cheers 
>
> Manuele 
>

-- 
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: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread 黄祥
pardon me, not sure what do you mean with free-text field? is it same like 
cell phone type of field (list:string)
e.g.
db.define_table('config',
Field('cell_phones', 'list:string', label=T('Dispatchers Cell Phone 
#s') ),
Field('service_provider_name', 'list:string', label=T('Service Provider 
Name') ) 
)

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: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread at

Initially I was thinking the same, but results are not as desired:


db.define_table('phone',
Field('service_type', 'string'),
Field('phone_number', 'string'))

db.define_table('config2',
Field('cell_phones', 'list:reference phone'), label=T('Dispatchers Cell 
Phone #s'))

Thanks,
AT

On Friday, 13 November 2015 11:09:02 UTC+5, 黄祥 wrote:
>
> sorry, perhaps you can use list:reference type of field for that.
> - create table that store cell phone number and it's service type
> - then define config table that have list:reference to the table that 
> store cell phone number and service type.
> - another thing is if you want to add new cell phone number and service 
> type that not recorded yet and want to remain in that page form, consider 
> use the modal that have form to input new data cell phone number and 
> service type
>
> best regards,
> stifan
>
> On Friday, November 13, 2015 at 12:36:54 PM UTC+7, at wrote:
>>
>> Hi Stifan,
>>
>> Thank you for your prompt reply. This will not give the desired result. 
>> After your suggested change, I get:
>>
>>
>> What I need is service-type and phone-number side-by-side, so when I add 
>> a record it should add one service-name and one corresponding phone number.
>>
>> Best Regards,
>> AT
>>
>> On Friday, 13 November 2015 09:56:32 UTC+5, 黄祥 wrote:
>>>
>>> pardon me, not sure what do you mean with free-text field? is it same 
>>> like cello phone type of field (list:string)
>>> e.g.
>>> db.define_table('config',
>>> Field('cell_phones', 'list:string', label=T('Dispatchers Cell Phone 
>>> #s') ),
>>> Field('service_provider_name', 'list:string', label=T('Service 
>>> Provider Name') ) 
>>> )
>>>
>>> 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: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread 黄祥
sorry, perhaps you can use list:reference type of field for that.
- create table that store cell phone number and it's service type
- then define config table that have list:reference to the table that store 
cell phone number and service type.
- another thing is if you want to add new cell phone number and service 
type that not recorded yet and want to remain in that page form, consider 
use the modal that have form to input new data cell phone number and 
service type

best regards,
stifan

On Friday, November 13, 2015 at 12:36:54 PM UTC+7, at wrote:
>
> Hi Stifan,
>
> Thank you for your prompt reply. This will not give the desired result. 
> After your suggested change, I get:
>
>
> What I need is service-type and phone-number side-by-side, so when I add a 
> record it should add one service-name and one corresponding phone number.
>
> Best Regards,
> Atif
>
> On Friday, 13 November 2015 09:56:32 UTC+5, 黄祥 wrote:
>>
>> pardon me, not sure what do you mean with free-text field? is it same 
>> like cello phone type of field (list:string)
>> e.g.
>> db.define_table('config',
>> Field('cell_phones', 'list:string', label=T('Dispatchers Cell Phone 
>> #s') ),
>> Field('service_provider_name', 'list:string', label=T('Service 
>> Provider Name') ) 
>> )
>>
>> 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] SQLFORM.grid export and user_signature issue

2015-11-12 Thread Carlos Kitu
There seems to be an issue with export (any class of export: csv, tsv, ...) 
in SQLFORM.grid when using user_signature and the corresponding decorator.
Pressing any export button in that context generates a:

Not authorized. Insufficient privileges - Error

Here is a minimal example of the code:

*db_00.py*
db.define_table('table01',
Field('field01', 'string', length=50, notnull=True, unique=False, label=
'field01', comment='field01'))



*default.py*
def first():
redirect(URL('second', user_signature=True))


@auth.requires_signature()
@auth.requires_login()
def second():
grid=SQLFORM.grid(db.table01, 
  csv=True,
  user_signature=True)
return grid



Once logged in, I'm calling default/first, just to get a signed url to 
default/second, where the grid is shown. Then I press the export button, 
getting the aforementioned error.

Removing the @auth.requires_signature() decorator makes everything work 
fine.

Web2py version used:
2.12.3-stable+timestamp.2015.08.19.00.18.03
(Ejecutando en Rocket 1.2.6, Python 2.7.6)

Any help will be greatly appreciated.
Best 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] Re: Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread at
Hi Stifan,

Thank you for your prompt reply. This will not give the desired result. 
After your suggested change, I get:


What I need is service-type and phone-number side-by-side, so when I add a 
record it should add one service-name and one corresponding phone number.

Best Regards,
Atif

On Friday, 13 November 2015 09:56:32 UTC+5, 黄祥 wrote:
>
> pardon me, not sure what do you mean with free-text field? is it same like 
> cello phone type of field (list:string)
> e.g.
> db.define_table('config',
> Field('cell_phones', 'list:string', label=T('Dispatchers Cell Phone 
> #s') ),
> Field('service_provider_name', 'list:string', label=T('Service 
> Provider Name') ) 
> )
>
> 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: db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Mark Billion
Works like a charm.  Thanks

On Thursday, November 12, 2015 at 11:46:33 AM UTC-5, Anthony wrote:
>
> db.x.id.belongs([list, of, ids])
>
>
>
> On Thursday, November 12, 2015 at 11:35:48 AM UTC-5, Mark Billion wrote:
>>
>> I want to select all database rows with ids in a preset list ... contains 
>> grabs everything that is like the list entry -- i.e. .contains(1) will snag 
>> records 1, 12, etc.  And 'in' obviously doesnt work.  Thoughts?
>>
>

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


[web2py] securing download function

2015-11-12 Thread Mark Billion
Im not sure if this is necessary/redundant, but here is my question:

Is there any way to check permission for the download -- i.e.,  the client 
associated with the file is checked and confirmed prior to the initiation 
of the dl without having to pass extra vars -- i.e., just using the 
filename that is passed as an argument?

db.define_table('foo',
Field('client', ...),
Field('file', ...),
Field('auth_user', ...),
)


def download():
*In pseudocode:*
*q = db(db.foo.file == [filename]).select().last()*
*if q.auth_user != auth.user.id:*
*  redirect/fail*
"""
allows downloading of uploaded files
http:///[app]/default/download/[filename]
"""
return response.download(request, db)

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


Re: [web2py] Re: web2py flash using bootstrap3 alerts and flash status is way to bothersome to implement

2015-11-12 Thread Richard Vézina
Thanks for "$.web2py.flash()" Leonel... I needed just that...

:)

I think this is something missing in the book search with "$.web2py.flash"
in the book return nothing.

Thank you...

Richard

On Fri, Jun 27, 2014 at 4:11 PM, Niphlod  wrote:

> unfortunately, the main point is that web2py doesn't provide
> "out-of-the-box" something that clarifies what a "flash status" is .
> passing a status as a new header uses the same "tech" web2py provides for
> other things, but since it's not in the core code, your shortcomings are
> exactly what is needed.
>
> On Friday, June 27, 2014 4:59:39 PM UTC+2, Leonel Câmara wrote:
>>
>> Hey,
>>
>> I wanted to change web2py response.flash to use bootstrap3 alerts.
>>
>> I started by creating an alert-default in my css since bootstrap3 doesn't
>> have one and I wanted it, then I placed this in my layout.html
>>
>>
>> {{if response.flash:}}
>>   {{=response.flash}}
>>   > data-dismiss="alert">> class="sr-only">Close
>>   {{pass}}
>>
>> response.flash_status was my solution so the controllers were able to
>> determine what kind of flash they would want the view to show, this was
>> working quite well until I started having stuff working via ajax. If a
>> request was done using ajax all my alerts were being shown with default.
>> After a bit of digging I found that  $.web2py.flash also had a "status"
>> argument that could add a class so I thought this would be quite simple.
>> Nothing could be further from the truth. In the end I had to do this:
>>
>> 1. Add this to my models
>>
>> def ajax_flash_status(view):
>> import urllib2
>> if response.flash:
>> if not response.flash_status:
>>  response.flash_status = 'default'
>> response.headers['web2py-component-flash-status'] = \
>> urllib2.quote('alert-'+xmlescape(response.flash_status)\
>>   .replace('\n',''))
>> return view
>> if request.ajax:
>> response.postprocessing.append(ajax_flash_status)
>>
>>
>> 2. Add a js file to the project which I add after all the other js files
>> containing this:
>>
>> $.web2py.after_ajax = function (xhr) {
>> /* called whenever an ajax request completes */
>> var command = xhr.getResponseHeader('web2py-component-command');
>> var flash = xhr.getResponseHeader('web2py-component-flash');
>> var flash_status =
>> xhr.getResponseHeader('web2py-component-flash-status');
>> if(command !== null) {
>> eval(decodeURIComponent(command));
>> }
>> if(flash) {
>> $.web2py.flash(decodeURIComponent(flash),
>> decodeURIComponent(flash_status));
>> }
>> };
>>
>> $.web2py.flash = function (message, status) {
>> var flash = $('.flash');
>> $.web2py.hide_flash();
>>
>> flash.html(message);
>> if (typeof status !== 'undefined') {
>> flash.removeClass('alert-default alert-success alert-info
>> alert-warning alert-danger').addClass(status);
>> }
>> if(flash.html()) {
>>   flash.append(
>> '' +
>> '' +
>> w2p_ajax_close_message +
>> '' +
>> ''
>>   ).slideDown();
>> }
>> };
>>
>>
>> Anyway, my question is, am I doing something wrong here? Wasn't there a
>> simpler way to implement 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.
>

-- 
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] Dynamic addition of name-value pairs using SQLFORM or CRUD

2015-11-12 Thread at



Hi,

Following is a simple form where users can enter their phone numbers. A 
user can enter as many numbers as he wants. How can I make it to take 
another free-text field as input like service provider name? Seems to be a 
simple thing but not sure how to achieve?

model/db.py
db.define_table('config',
Field('cell_phones', 'list:string'), label=T('Dispatchers Cell Phone #s'
))


controllers/phoneconfig.py
form = crud.update(db.config, 1)


views/phoneconfig/index.html
{{extend 'layout.html'}}
{{=form}}

Thanks,
AT

-- 
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] db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Mark Billion
I want to select all database rows with ids in a preset list ... contains 
grabs everything that is like the list entry -- i.e. .contains(1) will snag 
records 1, 12, etc.  And 'in' obviously doesnt work.  Thoughts?

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


[web2py] Re: db(db.x.id in [foo, man, chu]).select() does not work

2015-11-12 Thread Anthony
db.x.id.belongs([list, of, ids])



On Thursday, November 12, 2015 at 11:35:48 AM UTC-5, Mark Billion wrote:
>
> I want to select all database rows with ids in a preset list ... contains 
> grabs everything that is like the list entry -- i.e. .contains(1) will snag 
> records 1, 12, etc.  And 'in' obviously doesnt work.  Thoughts?
>

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


[web2py] Re: DAL returns string fields not as unicode strings

2015-11-12 Thread Dandelion Mine
I tried it on 2.12.3-stable:
>>> db = DAL('sqlite://storage.sqlite')
>>> db._db_codec
'UTF-8'
>>> db.define_table('unicode_test', Field('test', 'string'))

>>> test_val = unicode('på Facebook', 'utf-8')
>>> db.unicode_test.insert(test=test_val)
1L
>>> for r in db(db.unicode_test).select(): print r.test, type(r.test)
... 
på Facebook 
>>> db.unicode_test[1].test
'p\xc3\xa5 Facebook'
>>> db.unicode_test[1].test.decode('utf-8')
u'p\xe5 Facebook'

On Wednesday, November 11, 2015 at 5:52:47 PM UTC+3, Massimo Di Pierro 
wrote:
>
> The strings you get are probably UTF8. Can you confirm?
>
> On Wednesday, 4 November 2015 08:19:41 UTC-6, Dandelion Mine wrote:
>>
>> Hello!
>> According to Web2py book, 'by default web2py uses utf8 character encoding 
>> for databases'. I get the contrary results: there are fields with type 
>> 'string', mysql shows that they have collation utf8_general_ci, but when I 
>> select them with DAL, the type of returned fields are 'str', not 'unicode'.
>>
>> db.define_table('customers',
>> Field('name', 'string'))
>>
>> +---+--+-+--
>> | Field | Type | Collation   | Null | Key | 
>> +---+--+-+--+
>> | name  | varchar(512) | utf8_general_ci | 
>>
>> print type(db(db.tradera_customers).select().first().name)
>> 
>>
>> I tried to remove *.table in databases and to use db_codec parameter for 
>> DAL, but nothing changed.
>>
>> Web2py version 2.9.11-stable, Python 2.7.9, MySQL ver 14.14 Distrib 5.5.40
>>
>> Is it a known bug or I'm doing something wrong?
>> Thanks in advance.
>>
>

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


[web2py] Indexes

2015-11-12 Thread Fabiano Almeida
Hi All!

In book

I see example how to create index with executesql . How to use indexes in
querys?

Thx,

Fabiano.

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


Re: [web2py] Re: web2py and python3

2015-11-12 Thread Massimo Di Pierro
I do not think it is a secret. As far as I know the security pricing 
infrastructure of Bank of America is based on proprietary object database 
built in Python and the JP Morgan Chase has been working for some time on 
an internal trading platform based on Python (do not know if it is in use 
at this time). Also I have consulted with some local trading companies in 
Chicago that use Python+pytable+numpy+hdf5.

Here is a 
source 
https://www.quora.com/Why-are-banks-like-JP-Morgan-and-Bank-of-America-Merrill-Lynch-using-Python-to-replace-historic-legacy-systems-built-in-Java-C++
 
but I have my own sources. :-)

In fact a friend told me Bank of America uses web2py too although not for 
business critical apps where they use proprietary code, but for interfacing 
some of their Air Conditioning systems. I have been unable to verify this 
information. I know other banks or large financial institutions that also 
use web2py for some of internal non-business critical development.

Massimo

On Wednesday, 11 November 2015 09:34:41 UTC-6, Ramos wrote:
>
> What banks? can you share that info ?
>
> 2015-11-11 15:21 GMT+00:00 Massimo Di Pierro :
>
>> As of today python 3 is used almost exclusively in schools. Do you know 
>> of any large company that uses Python 3? I do not. But I know many large 
>> companies that use Python 2, including banks.  
>>
>>
>> On Monday, 9 November 2015 01:36:40 UTC-6, Remco Boerma wrote:
>>>
>>> Great one Alex. 
>>>
>>> While searching for web2py and python3 the first result i got was this 
>>> . 
>>>  
>>>
 Hi...I m total beginner in python with elastic search also Unicode ... 
 I am looking for a wonderful framework & was keen on web2py..but just 
 happened to read that its not compatible with python 3..

 Pl guide me abt this issue & in selecting framework

 With regards to all,

>>>
>>> I've been asked to start a new internship-company for a project i'm 
>>> involved in. And I so want to take those boys and girls on the web2py path, 
>>> but to ask of those new-to-the-market to invest in a legacy language (2020 
>>> is only 4 years from now) is something that feels odd to me. Especially 
>>> since i know the power and grace of web2py. 
>>>
>>> I know the subject has been debated and debated but for the sake of 
>>> these students (and these are not the high university kind, but rather the 
>>> ground-work and getting-stuff-done folks) i would kindly ask to take the 
>>> future into consideration as well as our marketing because web2py is simply 
>>> droped out of the equation because of py2. I would love to teach those kids 
>>> web2py and be future proof. Many schools already teach things from a 
>>> hundred years ago, let's not do that in IT as well. 
>>>
>>> Thank your for considering. 
>>>
>>> Op vrijdag 6 november 2015 23:57:33 UTC+1 schreef Alex:

 web2py for python 3 would be great. I hope it comes rather sooner than 
 later. I'd love to use python 3, no more str <-> unicode nonsense (which 
 already caused many issues and wasted time for me), type hints (seems to 
 have good support in PyCharm) and other new features. I think the current 
 situation could also scare away potential new users when they see that 
 web2py does not support python 3.

 pyDAL seems to be already compatible with python 3. Is it not possible 
 to make the remaining parts also compatible or are there completely new 
 concepts planned? I for one would completely remove the FORM code - it's 
 nice and easy to get something up and running but difficult to style (no 
 clear separation of backend/frontend) and extend. I'm using knockout (I 
 guess any data binding js lib will do fine) which is very flexible and 
 easy 
 to understand. That should be the preferred way to do forms and 
 recommended 
 in the book. But that's just my opinion. No more FORM would mean less code 
 to port to python 3 ;)

 Alex

 On Wednesday, November 4, 2015 at 4:37:56 PM UTC+1, Ramos wrote:
>
> @massimo 
> When will it be available ? 
>
>
> 2015-11-04 14:38 GMT+00:00 Massimo Di Pierro :
>
>> There will be a new framework similar to web2py for python 3. web2py 
>> has to be backward compatible and it is pointless to port it to python 
>> 3. 
>>
>>
>> On Wednesday, 4 November 2015 06:25:40 UTC-6, Jim Gregory wrote:
>>>
>>> I know this has come up in the past, but it hasn't been asked in a 
>>> while. 
>>>
>>> Is there ever going to be a usable and maintained Python3-compatible 
>>> fork of web2py?
>>>
>>> The latest edition of Fedora now ships with Python3 by default. It's 
>>> the default version used in Django's tutorial.
>>>
>>> I'm not using Python3 now, but I can see the day when I inevitably