[web2py] Re: How can I access functions from multiple files in the controllers directory?

2016-11-04 Thread Anthony
> > @anthony > why db, auth and mail must define current in models while request, > response, session, cache, and T objects, can work on the fly in modules > without define current (e.g. current.T) in models? > request, response, session, cache, and T are all web2py API objects, so they can be

Re: [web2py] .git file in gluon/packages/dal/.git

2016-11-04 Thread Massimo Di Pierro
I will remove it from the next packaging. sorry about that. On Thursday, 3 November 2016 14:40:39 UTC-5, Niphlod wrote: > > ok, now it's clear. probably a packaging error on mdipierro's side. > > On Thursday, November 3, 2016 at 2:48:45 PM UTC+1, Giles Thomas wrote: >> >> @Niphlod -- the confusing

[web2py] Re: Version in admin lists "(Running on %s)" instead of providing server info

2016-11-04 Thread Rick Williams
Hi, I see this rather old thread... But I'm running web2py from a virtualenv on rhel 7. My systemd starts web2py with: [Service] WorkingDirectory=/opt/apps/ncemon/ncemoncc4/web2py Environment=VIRTUAL_ENV="/opt/apps/ncemon/ncemoncc4/ENV" Environment=PATH="$VIRTUAL_ENV/bin:$PATH" ExecStart=/opt/ap

[web2py] Unit Testing in PyCharm

2016-11-04 Thread 'Roman' via web2py-users
Hi people. Short question: is there a way to run unit tests for my web2py controllers from PyCharm? I am running the latest web2py with version: 2.14.6-stable What i found out so far: There is an approach to run unit tests from command line. Following this blogpost: http://web2py.com/AlterEg

[web2py] switch to python 3

2016-11-04 Thread saeed mehrabi
Hello When do you want to switch to python 3? I am waiting impatiently. 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 me

[web2py] Memory leak in standalone DAL

2016-11-04 Thread Sukhmeet Toor
Hi web2py-users, I have an application that runs on CherryPy (v8.1.2) on Ubuntu (14.04.5 LTS) and python 2.7.6. I use standalone pyDAL (v16.09) to connect to my MySQL DB on AWS RDS. I'm seeing a constant memory leak on my servers which causes the process to use up 100% of RAM in a few hours and

[web2py] data not persisted with pyDAL?

2016-11-04 Thread Anthony
When using the DAL outside of a web2py HTTP request, you must call db.commit() to commit any changes you make (web2py does this automatically at the end of every HTTP request). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] data not persisted with pyDAL?

2016-11-04 Thread Terrence Monroe
Hello, I have a very simple standalone pyDAL program which defines a database in one module : db = DAL('sqlite://storage.db') market = db.define_table( 'market', Field('name'), Field('low', type='double'), Field('timestamp',

[web2py] Re: scheduler creates "zombie" processes

2016-11-04 Thread Erwn Ltmann
On Friday, November 4, 2016 at 10:44:31 PM UTC+1, Niphlod wrote: > > BTW: do your task write a lot on stdout/stderr and/or return huge results ? > Probably. I wrote into the log more than usual. :( Mostly DEBUGs - it's possible to switch off them. -- Resources: - http://web2py.com - http://web2

[web2py] Re: scheduler creates "zombie" processes

2016-11-04 Thread Niphlod
BTW: do your task write a lot on stdout/stderr and/or return huge results ? On Friday, November 4, 2016 at 10:43:34 PM UTC+1, Niphlod wrote: > > well, on unix python docs report that p.terminate() use sigkill, so I > wonder why in your env one works and not the other... > > On Friday, November 4,

[web2py] Re: scheduler creates "zombie" processes

2016-11-04 Thread Niphlod
well, on unix python docs report that p.terminate() use sigkill, so I wonder why in your env one works and not the other... On Friday, November 4, 2016 at 8:57:34 AM UTC+1, Erwn Ltmann wrote: > > BTW: if I use os.kill(p.pid,signal.SIGKILL) instead of p.termiate() > everithing is fine. > > 11-04

[web2py] Re: How can I access functions from multiple files in the controllers directory?

2016-11-04 Thread 黄祥
a, sorry forgot to mention it about current, n anthony already mention it *e.g.models/db.py* from gluon import current current.db = db current.auth = auth current.mail = mail @anthony why db, auth and mail must define current in models while request, response, session, cache, and T objects, can

Re: [web2py] Re: form error: duplicate field in table no_table

2016-11-04 Thread Alex Glaros
just re-read documentation for factory which says: This only works when the tables don't have field names in common. -- 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 I

Re: [web2py] Re: form error: duplicate field in table no_table

2016-11-04 Thread Alex Glaros
that's correct Richard, I use the same foreign key name in two tables. But how to handle properly as you imply? Give it some sort of alias name somewhere? In below form, field organization_fk exists in both tables db.auth_membership, and db.meeting_segment. organization_fk is not mentioned i

[web2py] Re: How can I access functions from multiple files in the controllers directory?

2016-11-04 Thread Anthony
> > *modules/test.py* > from gluon import * > > def insert_table_event(time_stamp, client_ip, user_id, origin, > description): > current.db.auth_event.insert(time_stamp = time_stamp, > client_ip = client_ip, > user_id = user_id, > origin = origin, > description = description) > Note, current

Re: [web2py] Re: form error: duplicate field in table no_table

2016-11-04 Thread Richard Vézina
You must have use the same field name for referenced field in both table and didn't handle this properly while using .factory(), since you lost table_name for disambiguation you get this trace back... Richard On Fri, Nov 4, 2016 at 11:53 AM, Anthony wrote: > On Thursday, November 3, 2016 at 11:

[web2py] Re: How can I access functions from multiple files in the controllers directory?

2016-11-04 Thread Anthony
On Friday, November 4, 2016 at 11:09:57 AM UTC-4, Fabio Ceccarani wrote: > > Hi, usefull response, > but in function defined in test.py variables as session, db, request (and > other function defined in default.py) are not visible. > Is it normal or there's a way to make they somehow global? >

[web2py] Re: form error: duplicate field in table no_table

2016-11-04 Thread Anthony
On Thursday, November 3, 2016 at 11:19:21 PM UTC-4, Alex Glaros wrote: > > I think this error arises when two tables in factory have same field name. > I usually get around this by naming one of the fields differently, but best > practice is to name same foreign key identically in all tables it i

[web2py] Re: form error: duplicate field in table no_table

2016-11-04 Thread Alex Glaros
The only other way I can think of getting around this is, instead of renaming the table fields, create virtual fields and insert values using the insert method. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://c

[web2py] Re: How can I access functions from multiple files in the controllers directory?

2016-11-04 Thread Fabio Ceccarani
Hi, usefull response, but in function defined in test.py variables as session, db, request (and other function defined in default.py) are not visible. Is it normal or there's a way to make they somehow global? Or the only way is to past as argument session, db, request? And for call funtions de

[web2py] MS SQLServer in Latin1

2016-11-04 Thread Jose
Hello, To cut a long explanation, I have the following: MS-SQLServer <-> FreeTDS <-> unixODBC <-> pyODBC <-> DAL The database is in Latin1 The FreeTDS configuration adds client charset = UTF-8 Before putting "charset = UTF-8" had throughout the application encodes and decodes to make it work

Re: [web2py] convert request.vars to set default value in a custom .factory() form

2016-11-04 Thread Richard Vézina
Will see, if I can make a simplified version, that long... I appreciate your help Richard On Thu, Nov 3, 2016 at 10:01 PM, Anthony wrote: > On Thursday, November 3, 2016 at 4:10:04 PM UTC-4, Richard wrote: >> >> I can show you privately... >> > > Or maybe create a simplified example that demon

[web2py] Re: scheduler creates "zombie" processes

2016-11-04 Thread Erwn Ltmann
BTW: if I use os.kill(p.pid,signal.SIGKILL) instead of p.termiate() everithing is fine. 11-04 08:40:59.521 [13556] web2py.Scheduler - DEBUG - MD: terminating (os > kill) > 11-04 08:40:59.521 [13556] web2py.Scheduler - DEBUG - MD: terminated > 11-04 08:40:59.522 [13556] web2py.Scheduler - DEBUG

[web2py] Re: scheduler creates "zombie" processes

2016-11-04 Thread Erwn Ltmann
Sorry for using the term 'zombie'. In the context of unix it is misleading. On Thursday, November 3, 2016 at 9:25:41 PM UTC+1, Niphlod wrote: > > From where I stand, if the result is the task being labelled as TIMEOUT > (with the corresponding "task timeout" debug line), it can only be > origina

[web2py] load form in modal via ajax not submitting

2016-11-04 Thread Marco Mansilla
Hi, it's been a long time and now I have this really odd issue, I have a model like this: models/db_01.py db.define_table('dogs', Field('name'), Field('owner'), Field('age'), Field('adress')) In my view generate a grid, which has a lot of dogs, and each one had a modal to view de