[web2py] Filter with IS_IN_DB without changing record presentation format

2014-10-16 Thread Álvaro J . Iradier
Hi, I have a field in table 'expenses' defined as: db.define_table('expenses', Field('gang', db.gangs, required=True, notnull=True), ... Field('payer', db.gang_users, label=T('Payer')), ... Table gang_users has a format like: db.defi

[web2py] Re: Web2Py Pages module (basic CMS)

2014-05-07 Thread Álvaro J . Iradier
Back in 2011 I proposed using quoted identifiers for databases supporting it: https://groups.google.com/d/msg/web2py/aSPtD_mGXdM/4Eflv-edEUEJ I think the check_reserved option is a valid fix, but databases like PostgreSql that allow using any word as identifier by quoting it should use this in

Re: [web2py] Detect web2py main process exit on cron process

2013-03-06 Thread Álvaro J . Iradier
Proposition: I have made a small proposed patch to newcron.py, in order to keep a list of cron subprocesses and send a terminate signal when web2py exists. See attached newcron.py.diff. A lock should be added when accessing the _cron_subprocs list, to avoid thread concurrency. Also, I noticed tha

Re: [web2py] Re: Import problem in Web2py 2.3.2 vs 1.99.4

2013-02-06 Thread Álvaro J . Iradier
Works, but the identation at the "else:" on line 84 in custom_import.py is wrong. FIxed identation, and it apparently works perfect. Thanks very much! On Wed, Feb 6, 2013 at 6:35 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > I agree. I am have attempted a fix. Can you try it? > >

Re: [web2py] Re: Import problem in Web2py 2.3.2 vs 1.99.4

2013-02-05 Thread Álvaro J . Iradier
I agree they should get priority over system wide modules, but not over imports for files on the same directory. So in Geraldo reports, it does not make sense that in the situation: .../site-packages/geraldo/generators/__init__.py -> from pdf import PDFGenerator .../site-packages/geraldo/geraldo/g

[web2py] Web2py upload behind apache mod proxy

2012-02-16 Thread Álvaro J . Iradier
Hi, I have a testing web2py environment running on a system on port 8000, and then apache2 using mod_proxy to redirect requests to a virtual host on port 80 to the web2py rocket server. This is the apache config for the vhost: --- ... Order deny,allow Allow from

[web2py] Re: Web2py binary distribution and psycopg2 driver

2012-01-11 Thread Álvaro J . Iradier
ndle it with web2py binary. Greets. On Jan 11, 11:55 am, Alan Etkin wrote: > I think i installed one of the listed binary files listed here without > problems:http://stickpeople.com/projects/python/win-psycopg/ > > Regards > > On 10 ene, 17:14, Álvaro J. Iradier wrote: >

[web2py] Re: Web2py binary distribution and psycopg2 driver

2012-01-10 Thread Álvaro J . Iradier
Does setup_exe.py work at all? When I run it, A "PyFPDF Template Designer" pop ups. The line causing it is: from gluon.import_all import base_modules, contributed_modules Trying setup_exe_2.6.py, there is a syntax error in line 113: if os.path.exists('dist/site-packages') shutil.rmtr

[web2py] Web2py binary distribution and psycopg2 driver

2012-01-10 Thread Álvaro J . Iradier
Hi, I was trying to distribute an application with web2py binary for windows, but I required the PostgreSQL driver. So I copied the psycopg2 files to site-packages in the web2py binary folder. If I start a shell from an application, I can import psycopg2 and connect to the database. However, it l

[web2py] Re: migrating to postgres error

2012-01-03 Thread Álvaro J . Iradier
There is also an old thread I started some time ago about quoting identifiers: http://www.mail-archive.com/web2py@googlegroups.com/msg68661.html Greets. On 31 dic 2011, 15:15, Anthony wrote: > On Saturday, December 31, 2011 7:33:30 AM UTC-5, Plumo wrote: > > > ah thanks - that was it. I heard a

[web2py] Re: URL inside .load component

2011-08-24 Thread Álvaro J . Iradier
Thanks very much, that made it. I couldn't find documentation about the extension=False option for the URL function, it would be nice to have it in the book. Greets. On 23 ago, 18:47, Anthony wrote: > On Tuesday, August 23, 2011 12:14:43 PM UTC-4, Álvaro J. Iradier wrote: > > &g

[web2py] URL inside .load component

2011-08-23 Thread Álvaro J . Iradier
Hi, I've created a component mycomponent.load to be used with the LOAD() method. But inside the mycomponent.load I want to have a link to another function in the same controller. When I do: {{=URL(r=request, f='otherfunction')}}, the .load extension is automatically added, so I end up being linke

[web2py] Re: Postgres quoted identifiers

2011-08-07 Thread Álvaro J . Iradier
keeping my own modified version of web2py forever, that is why I am asking if this might be included in a future version. Just let me know. Greets. On 29 jul, 12:03, Massimo Di Pierro wrote: > This is a good idea. Let me give this some thought. > > On Jul 28, 10:35 am, Álvar

[web2py] Re: Postgres quoted identifiers

2011-07-28 Thread Álvaro J . Iradier
to allow this. The reason it was never > implemented fully is that I cannot find documentation about this for > all supported db engines. Implementing this only for mysql and pgsql > is a pain. > > On Jul 27, 2:34 pm, Álvaro J. Iradier wrote: > > > > > > > > &

[web2py] Postgres quoted identifiers

2011-07-27 Thread Álvaro J . Iradier
Hi, migrating my application to Postgres, I've been hit by the "user" reserved keyword problem previously commented on http://groups.google.com/group/web2py/browse_thread/thread/f23c03ff8143b55/15602d3158ae5e6c. According to PostgreSQL documentation, http://www.postgresql.org/docs/8.2/static/sql-

[web2py] Re: Inner join on subselect

2011-07-17 Thread Álvaro J . Iradier
At first I thought this was exactly what I was looking for... but after trying, sorry, but this query doesn't work for me... it returns 0 records, while the previous one is returning the right number. It looks like the GROUP BY selects one of the dates (the first record found) for the grouping, the

[web2py] Re: Inner join on subselect

2011-07-17 Thread Álvaro J . Iradier
ow to do this using the DAL. Greets. On 17 jul, 22:45, Álvaro J. Iradier wrote: > Hi, I have a table with a record of values read from a device. Table > has a parameter ID, the record date, and the parameter value: > > db.define_table('param_values', >     Field(&#

[web2py] Inner join on subselect

2011-07-17 Thread Álvaro J . Iradier
Hi, I have a table with a record of values read from a device. Table has a parameter ID, the record date, and the parameter value: db.define_table('param_values', Field('param', db.dev_parameter, required=True, notnull=True), Field('date', 'datetime', required=True, notnull=True), Fiel

[web2py] Re: Broken pipe with mysql

2011-06-15 Thread Álvaro J . Iradier
I agree with Ron. If connection is broken between 4 and 5, I would expect the transaction to be rollback (it was not commited), and an error raised. Probably that request will fail, but at least the connection is not dropped and not recoverable. I guess in a server restart or shutdown, the server

[web2py] Re: Broken pipe with mysql

2011-06-15 Thread Álvaro J . Iradier
happen. Edit the > mysql config file and change the timeout. If the database is > restarted, web2py needs restarting because there is no mechanism in > the database connection API to notify web2py (or python) that a > connection lost. > > On Jun 14, 4:06 pm, Álvaro J. Iradier wrot

[web2py] Broken pipe with mysql

2011-06-14 Thread Álvaro J . Iradier
As seen in this thread: http://groups.google.com/group/web2py/browse_thread/thread/c6653dadbea77f0d/06ed6fe085eae33c I'm getting "broken pipe" messages when mysql is restarted, and under other circunstances. Going to a shell, I tried doing a query, for example: >>> db(db.location).select() ev

[web2py] Re: Project: pydev extension for web2py in Eclipse

2011-06-13 Thread Álvaro J . Iradier
in the latest web2py version? > > I am talking specially about the new importer, the 'current' object and the > models subfolders. > > Is that being considerated? > > On Thu, Jun 9, 2011 at 6:11 PM, Álvaro J. Iradier wrote: > > > > > > > > &

[web2py] Re: Project: pydev extension for web2py in Eclipse

2011-06-09 Thread Álvaro J . Iradier
Yes, I checked that project, but these way would require not adding anything at the headers, and it also parses the models file. It requires no modification in web2py, just in Pydev. Talking to the pydev author in the pydev mailing list, he might consider including support for web2py if we manage

[web2py] Re: Project: pydev extension for web2py in Eclipse

2011-06-09 Thread Álvaro J . Iradier
is customizable per project. Comments and help are welcome! Greets. On 29 abr, 10:51, Álvaro J. Iradier wrote: > Hi, > > I am trying to develop an extension (a Jython script[1]) for Pydev[2] to > improve web2py integration into Eclipse (I'm not sattisfied with the > existi

[web2py] Project: pydev extension for web2py in Eclipse

2011-04-29 Thread Álvaro J . Iradier
_scripting.html [2] http://pydev.org/ -- Álvaro J. Iradier Muro Departamento de Desarrollo alvaro.irad...@polartech.es Polar Technologies T +34 976 527 952 F +34 976 466 125 www.polartech.es Antes de imprimir este mensaje, por favor, compruebe que es verdaderamente necesario. El medioambiente es cosa de

[web2py] Re: Obtain label for field with IS_IN_SET

2011-01-20 Thread Álvaro J . Iradier
(Field('bedrijf',requires=IS_IN_SET([2,3,4,5,6,7],label > s=['Fitnesscentrum','Fysiofitnesscentrum','Personal > Trainer','Dietist(e)','Voedingsconsulent(e)','Yogaschool'],zero=None))) > > On Jan 20, 3:15 pm, Álvaro J. Ir

[web2py] Obtain label for field with IS_IN_SET

2011-01-20 Thread Álvaro J . Iradier
I found thread where someone asked exactly the same question I'm trying to solve: http://groups.google.com/group/web2py/browse_thread/thread/ba58ec07a23b0393/ but the question wasn't answered, quoting from the last post: --- ... In a controller I defined a form: form=SQ

[web2py] Re: The stability of web2py releases

2010-12-22 Thread Álvaro J . Iradier
Given the pace of quick adoption for new versions of web2py, I think it would be good enough to mark a new release (except if it's just a bug fix release) like "latest" or "edge release", and just keep the previous one as "recommended". After some days (for example one week), without new releases,

[web2py] Patch for cron not working on compiled apps

2010-10-27 Thread Álvaro J . Iradier
s not working for bytecode compiled applications, as it's searching for the .py file: cfile = os.path.join('applications', a, 'controllers', c + '.py') Suggested patch attached. Greets. -- Álvaro J. Iradier Muro Departamento de Desarrollo alvaro.irad...@polartech.es

[web2py] Re: cron @reboot not working on 1.87.3

2010-10-15 Thread Álvaro J . Iradier
if val != '-1' and '-' in val and '/' not in val: val = '%s/1' % val if '/' in val: task[id] += rangetolist(val, id) Please confirm if you're going to apply it. Greets. On

[web2py] Re: cron @reboot not working on 1.87.3

2010-10-14 Thread Álvaro J . Iradier
if line.startswith('@reboot'): 154 line=line.replace('@reboot', '-1 * * * *') However, I can't guess what the fix is... Greets. On 14 oct, 22:34, Álvaro J. Iradier wrote: > Thanks very much. > > Ok, so after trying: > > Works i

[web2py] Re: cron @reboot not working on 1.87.3

2010-10-14 Thread Álvaro J . Iradier
ww.web2py.com/examples/static//web2py_src.zip > > http://www.web2py.com/examples/static/1.81.4/web2py_src.zip > > 2010/10/14 Álvaro J. Iradier > > > > > > > After upgrading web2py from 1.81.4 to latest 1.87.3, cron jobs at > > @reboot stopped working. This i

[web2py] cron @reboot not working on 1.87.3

2010-10-14 Thread Álvaro J . Iradier
After upgrading web2py from 1.81.4 to latest 1.87.3, cron jobs at @reboot stopped working. This is my crontab file: #crontab * * * * * root *cron/pollsensors * * * * * root *cron/checkschedule 0 0 * * * root *cron/cleandata @reboot root *cron/cleandata @reboot root *cron/pollingloop The two last

[web2py] Re: Sharing data between background worker and requests

2010-09-22 Thread Álvaro J . Iradier
t; > >http://stackoverflow.com/questions/1430446/create-a-temporary-fifo-na... > > > has pros and cons. data can be lost or corrupted if the reading/ > > writing app crashes. > > I would use the database because of transcaction safety. > > > Massimo > > > On

[web2py] Re: Sharing data between background worker and requests

2010-09-21 Thread Álvaro J . Iradier
g/ > writing app crashes. > I would use the database because of transcaction safety. > > Massimo > > On Sep 21, 3:21 pm, Álvaro J. Iradier wrote: > > > > > Hi, > > > I've setup a background worker thread using cron @reboot. The > > background worker is p

[web2py] Sharing data between background worker and requests

2010-09-21 Thread Álvaro J . Iradier
Hi, I've setup a background worker thread using cron @reboot. The background worker is polling some serial sensors all the time (there's a loop in class reading the sensor values). On some moment, the values are recorded and an alarm bit is set. Now, what I need is a way to share this information

[web2py] Re: Problem with crud.create and duplicate _formname

2010-09-09 Thread Álvaro J . Iradier
On 9 sep, 22:31, mdipierro wrote: > because you cannot ".accepts" a crud forms. It is implicit. You can do > > def index(): >    form = crud.create(db.contents,message='Inserted') >    return dict(form=form) > > On Sep 9, 2:51 pm, Álvaro J. Iradier

[web2py] Problem with crud.create and duplicate _formname

2010-09-09 Thread Álvaro J . Iradier
Hi, I think I found a problem (bug?) with crud.create and form.custom.end: I have the following model: db.define_table('contents', Field('name', 'string', required=True, notnull=True, requires=IS_NOT_EMPTY()), Field('ordering', 'integer', required=True, requires=IS_NOT_EMPTY()), Field('d

[web2py] Re: Table migration problems with Sqlite

2010-08-29 Thread Álvaro J . Iradier
fix it. > > I am not sure about dropping columns and SQLite. The problem only > appears when a user tries to re-define a column that was dropped. > Perhaps a warning instead of an exception? I would take a patch to > issue a logging.warn. > > On Aug 28, 12:32 pm, Álvaro J. I

[web2py] Re: Table migration problems with Sqlite

2010-08-28 Thread Álvaro J . Iradier
lose() > > > First, sql_fields_old is updated with the migrated value ONLY if query > > is not None. For sqlite it's None for changed columns. So, later, > > cPickle dumps the value of sql_fields_old, so the file > > _settings.table is written with the same old values, as this field > > was not migrated. > > > So, for every request, web2py detects a migration is needed, but it > > does nothing but writing the .table file with the old values. > > > I think the correct behaviour should be throwing an error if migration > > can't be done. > > > Can you suggest a fix for this? > > > Thanks very much. > > > -- > > Álvaro J. Iradier Muro > > Departamento de Desarrollo > > alvaro.irad...@polartech.es

[web2py] Table migration problems with Sqlite

2010-08-27 Thread Álvaro J . Iradier
t migrated. So, for every request, web2py detects a migration is needed, but it does nothing but writing the .table file with the old values. I think the correct behaviour should be throwing an error if migration can't be done. Can you suggest a fix for this? Thanks very much. -- Álvaro J. Iradier Muro Departamento de Desarrollo alvaro.irad...@polartech.es

[web2py] Cron task run twice when init is symbolic link

2010-07-17 Thread Álvaro J . Iradier
n (that is applications/init -> applications/myapplication) and skip running one of the crontabs? Thanks. -- Álvaro J. Iradier Muro Departamento de Desarrollo alvaro.irad...@polartech.es Polar Technologies T +34 976 527 952 F +34 976 466 125 www.polartech.es Antes de imprimir este mensa

[web2py] Re: Web2py on port 80 with non-root, setuid, possible?

2010-07-10 Thread Álvaro J . Iradier
> > What problem do you experience? > > On 8 Lug, 03:38, Álvaro J. Iradier > wrote: > > > > > Hi everybody, > > > I need to run web2py integrated web server, and I'd like to run it on port > > 80 as a non-root user, for security reasons. &g

[web2py] Web2py on port 80 with non-root, setuid, possible?

2010-07-08 Thread Álvaro J . Iradier
me on the right direction? Thanks very much. -- Álvaro J. Iradier Muro Departamento de Desarrollo alvaro.irad...@polartech.es Polar Technologies T +34 976 527 952 F +34 976 466 125 www.polartech.es