[web2py:15593] Re: Patch for missing HTML-helper LEGEND

2009-01-29 Thread Iceberg
Familiar discussion to me because I raised same topic before. :-) Glad to see LEGEND is in, it is not too late for me to quit the habbit of TAG.LEGEND. :-P Seriously speaking, I still suggest to make TAG. more noticeable (e.g. the first one in HTML helper section) in the builtin document as

[web2py:15594] Re: Able to do a table entries selection?

2009-01-29 Thread Maurice Ling
Hi Massimo, I was on this problem MadWalker this morning, perhaps I can offer some insights into the problem. This is essentially an electronic record-book project. 1. The "notebook" table contains the set of notebooks created. db.define_table('notebook', SQLField('name')) 2.

[web2py:15595] Re: provide a development flag for applications

2009-01-29 Thread achipa
I usually just set a constant in a models/conf.py (along with DB and other params which vary on the development and the deployment setup) and check for that. On Jan 28, 1:23 pm, rctay wrote: > Hi, > > what do you guys think of providing a global variable (at application- > level), say, WEB2PY_AP

[web2py:15596] Re: provide a development flag for applications

2009-01-29 Thread rctay
Hmm, you don't sound like you're using any VCS/SCM. anyway, by using that flag, you could minimize the possibility of human error (ie. the possibility that you forgot to update that variable on either setup while moving code between both). you could also debug your deployment setup quickly by tu

[web2py:15597] Re: provide a development flag for applications

2009-01-29 Thread achipa
I'm using svn and bzr. The conf.py file is usually on an ignore list and I provide a conf.example.py file (commented example entries) for reference. That way I have no live config data in the versioning system, and update/commit does not change the config file, so all is well (this is actually not

[web2py:15598] Re: provide a development flag for applications

2009-01-29 Thread rctay
Oh i see. Well what I'm proposing is that such a workflow (ie with a development flag) is shared with web2py users, not just among ourselves. :) On Jan 29, 10:58 pm, achipa wrote: > I'm using svn and bzr. The conf.py file is usually on an ignore list > and I provide a conf.example.py file (comm

[web2py:15599] Re: provide a development flag for applications

2009-01-29 Thread mdipierro
This would be considered a web2py level configuration flag and that is against to web2py phylosophy (no configuration). You should be able to mimic it anyway. you can set a environment variable (before starting web2py) and you should be able to see it in request.env.your_environment_variable. M

[web2py:15600] Re: Able to do a table entries selection?

2009-01-29 Thread mdipierro
I think you want: db.define_table('notebook', SQLField('name'),SQLField ('archived','boolean',default=False)) db.define_table('entry', SQLField('title'), SQLField('notebook',db.notebook)) and then you need as JOIN as you say records=db(db

[web2py:15601] Re: provide a development flag for applications

2009-01-29 Thread Robin B
Maybe web2py could endorse a 'standard' env variable, so people do not have to set more than one: WEB2PY_ENV_MODE = DEVELOPMENT | PRODUCTION | TEST | BENCHMARK I think environment modes are important especially for performance. If your app spends <1% of requests in development, and >99% in produ

[web2py:15602] Re: provide a development flag for applications

2009-01-29 Thread mdipierro
OK let's just use WEB2PY_MODE than and it will appear in request.env.web2py_mode Notice we aready have request.env.web2py_path request.env.web2py_version Massimo On Jan 29, 10:33 am, Robin B wrote: > Maybe web2py could endorse a 'standard' env variable, so people do not > have to set more t

[web2py:15603] Using Try Except to detect a specific MS SQL server error and flash a custom error msg

2009-01-29 Thread NetHead
Greetings everyone! This is my first post on this forum. My appreciation (in advance) for any help any of you can lend me. SYNOPSIS: My app uses Web2py along with MS Sql Server. I placed a unique constraint on a column in my SQL table, and if a user attempts to enter a duplicate value in th

[web2py:15604] Re: Using Try Except to detect a specific MS SQL server error and flash a custom error msg

2009-01-29 Thread mdipierro
According to this: http://code.google.com/p/pyodbc/wiki/Errors it should not do so. Can you provide an example of an error that raises IntegrityError but should not? Massimo On Jan 29, 10:23 am, NetHead wrote: > Greetings everyone! > > This is my first post on this forum. My appreciation (i

[web2py:15605] import_from_csv_file failure

2009-01-29 Thread Julius Minka
I put following code to a function in controller an ran it: db.export_to_csv_file(open('f7bkp','w')) for table in db.tables: db[table].truncate() db.import_from_csv_file(open('f7bkp','r')) export OK, drop tables OK, but import gave me: File "/home/julo/+/kubler/factor7/web2py/applica

[web2py:15606] Bug in T2 or SQLForm with upload field?

2009-01-29 Thread mfolmos
In my db.py I have a table definition with this field: SQLField("foto","upload",label="Foto") I can insert and edit the table with the generated t2 forms, but when I try to delete a record that have an empty upload field, it fails #edit function def editar_hacker(): form=t2.update(db.hackers,n

[web2py:15607] Re: Using Try Except to detect a specific MS SQL server error and flash a custom error msg

2009-01-29 Thread NetHead
Hello Massimo! Thank you for your reply. To clarify SQL Server is properly detecting a duplicate value when it is entered. It's Web2py's behavior when this error is detected that I'm trying to change. If you look at my original post again, I'm getting the error "NameError: global name 'In

[web2py:15608] Re: mysql max active connections

2009-01-29 Thread Baron
I'm using the webfaction hosting (Red Hat) and I haven't found mysql.conf yet. I didn't figure out the problem so I tried switching to postgres and now it is fine. On Jan 29, 2:31 pm, mdipierro wrote: > Connections are closed outside the controller so it should not be a > problem with your prog

[web2py:15609] Re: Using Try Except to detect a specific MS SQL server error and flash a custom error msg

2009-01-29 Thread mdipierro
probably you need from pyodbc import IntegrityError do not import it from psycopg since that is a different exception than the one thrown by mssql Massimo On Jan 29, 2:38 pm, NetHead wrote: > Hello Massimo! > > Thank you for your reply. > > To clarify > > SQL Server is properly detecting

[web2py:15610] Re: Bug in T2 or SQLForm with upload field?

2009-01-29 Thread mdipierro
This is a bug in t2 it will be fixed in the next version in a couple of days. Massimo On Jan 29, 2:16 pm, mfolmos wrote: > In my db.py I have a table definition with this field: > SQLField("foto","upload",label="Foto") > I can insert and edit the table with the generated t2 forms, but when > I

[web2py:15611] synchronisation

2009-01-29 Thread INeedHelp
i am currently working on synchronisation. I have 2 or more "projectA" in different computers and i would like to synchronise all the entries in the database from different computers when few entries are added into database. so at the end, all the computer would have the same entries in the datab