[web2py] upload file -- lot of file in one directory

2010-06-08 Thread szimszon
I wasn't able to continue the thread in http://groups.google.com/group/web2py/browse_frm/thread/a81248fec1dcef81/ So... I imagine that I would have lots of files say some 10 000 or more. :) I think with ext3/ext2... filesystems so many files in one directory is a mess. Is there absoute out of q

[web2py] Re: html5 test

2010-06-08 Thread Yarko Tymciurak
Ok - this link - html5test.com - has been updated, and Safari-5 is out today; Out of (now) a total possible 300 points: Safari 5.0 (6533.16): 208 + 10 bonus points; Chrome 5.0.375.70:197 + 7 bonus points; Safari 3.6.3139 + 4 Opera 10.53: 129 + 4 - Yarko

[web2py] Re: disable label

2010-06-08 Thread annet
Thanks for providing me with this solution, problem solved. I have another problem with this form. In the first column some of the field names are split up, like: Sub-dossiernumber * : Is there a way to solve this? Kind regards, Annet.

[web2py] Re: tos download

2010-06-08 Thread annet
Massimo, I used: > {{=A('terms of service',_href=URL(r=request,c='static',f='cms/files/ > tos_fitwise.pdf',vars=dict(attachment=True)))}} and it works, so problem solved thanks. Annet.

[web2py] Re: Detect App Admin

2010-06-08 Thread Sverre
Thank you! On 8 Jun, 15:18, mdipierro wrote: > import gluon.fileutils > is_logged_in_admin=gluon.fileutils.check_credentials(request) > > On Jun 8, 7:15 am, Sverre wrote: > > > Is it possible to detect if a developer is logged in the admin app? > > The purpose is to make some parts depending on

Re: [web2py] Re: Best CSS framework for web2py

2010-06-08 Thread Vasile Ermicioi
http://jqueryui.com/docs/Theming/API

[web2py] Re: eliminated repeat values

2010-06-08 Thread mdipierro
I changed the validator in trunk IS_IN_DB. Now it should be automatically grouping similar items. Optionally you can specify IS_IN_DB(...,groupby=...) Give it a try. On Jun 8, 11:07 pm, "mr.freeze" wrote: > Actually, that will not work since it modifies the collection in a > loop. Try this: > > d

[web2py] Re: eliminated repeat values

2010-06-08 Thread mr.freeze
Actually, that will not work since it modifies the collection in a loop. Try this: def unique_items_widget(f,v): inp = SQLFORM.widgets.options.widget(f,v) options = inp.elements('option') vals = [] inp.components = [] for opt in options: val = opt['_value'] if n

[web2py] Re: "Last Saved On" field displays "communication error" using HTTPS on Apache2, OpenSSL 0.98k, mod_wsgi, python 2.6.5

2010-06-08 Thread Salvor Hardin
I uninstalled simplejson 2.1.1 which I installed earlier by easy_install. web2py 1.79.2 is released and should work fine on Ubuntu 10.04 with os version of simplejson, too. On Jun 8, 8:21 pm, Thadeus Burgess wrote: > The simplejson shipped with web2py and the os version of simplejson > conflicte

[web2py] Re: Showing Country listing...

2010-06-08 Thread Richard
thanks for the reference. Somewhat related here is a Python structure for timezones that I use: TIME_ZONES = ( (-12, '(GMT-12) Eniwetok, Kwajalein'), (-11, '(GMT-11) Midway Island, Samoa'), (-10, '(GMT-10) Hawaii'), (-9, '(GMT-9) Alaska'), (-8, '(GMT-8) Pacific Time (US & Cana

[web2py] Re: electronic signature

2010-06-08 Thread mdipierro
You do not need this db.define_table('atable', SQLField('var1'), SQLField('var2',default=db(db.auth_user.id==auth.user_id).select(db.auth_user.initials).first().initials)) you can do db.define_table('atable', Field('var1'), Field('var2',default=auth.user and auth.user.initials)) b

[web2py] Re: "Last Saved On" field displays "communication error" using HTTPS on Apache2, OpenSSL 0.98k, mod_wsgi, python 2.6.5

2010-06-08 Thread mdipierro
I modified the one that ships in web2py in 1.79.1 and they should no longer conflict. Can you confirm? On Jun 8, 8:21 pm, Thadeus Burgess wrote: > The simplejson shipped with web2py and the os version of simplejson > conflicted is a really bad problem. > > I *need* simplejson installed on the sys

[web2py] Re: Advice, convert from string storing numbers to autoincrement integer

2010-06-08 Thread mdipierro
If it were possible to do a SQL insert without the dummy filed this almost the same as creating a sequence. web2py can create a table without any field but the "id", but I do not do not how to do an insert without any field value. On Jun 8, 8:12 pm, Thadeus Burgess wrote: > This *might* work. You

[web2py] Re: eliminated repeat values

2010-06-08 Thread mr.freeze
mdpierro is just saying that a simple patch needs to be made to IS_IN_DB. Until then, you can create a widget to remove duplicates: def unique_items_widget(f,v): inp = SQLFORM.widgets.options.widget(f,v) vals = [] for k, opt in enumerate(inp): if not opt['_value'] in vals:

[web2py] Re: eliminated repeat values

2010-06-08 Thread kike
In what part of the sentence vul.authors.name.requires=IS_IN_DB(vul,vul.authors.name) I need aggregate a groupby option to work, because in that sentence that parameter is incorrect and if I aggregate a groupby parameter in f=SQLFORM.factory(vul.authors.name) nothing append. How I can fixed that th

Re: [web2py] Re: electronic signature

2010-06-08 Thread Jean Guy
At the database level I was wondering myself if I will not use the initials as PK... It's not clear to me how I will manage the authentification. Some person ask for double authentification (LDAP - active directory) and an authentification for data creation. The database should be as decoupled as p

Re: [web2py] Re: "Last Saved On" field displays "communication error" using HTTPS on Apache2, OpenSSL 0.98k, mod_wsgi, python 2.6.5

2010-06-08 Thread Thadeus Burgess
The simplejson shipped with web2py and the os version of simplejson conflicted is a really bad problem. I *need* simplejson installed on the system so that other python programs can use it. However, I can't use web2py then! Very annoying situation. -- Thadeus On Tue, Jun 8, 2010 at 12:17 PM

Re: [web2py] Re: Advice, convert from string storing numbers to autoincrement integer

2010-06-08 Thread Thadeus Burgess
This *might* work. You are right, it is still horrible... It might be *effectively* accomplishing the same thing that sequences do on PostgreSQL, however I still wouldn't use it in production as it feels "hacky". I already have to re-design this table, so I might as well do it 100% right. I never

[web2py] Re: electronic signature

2010-06-08 Thread mr.freeze
I think it would be more useful to record the auth user id instead since you wouldn't be able to find the corresponding user record from the initials. On Jun 8, 5:29 pm, Jean Guy wrote: > Could it be a good practice to implement electronic signature of the > database records like this : > > db.de

[web2py] electronic signature

2010-06-08 Thread Jean Guy
Could it be a good practice to implement electronic signature of the database records like this : db.define_table('atable', SQLField('var1'), SQLField('var2',default=db(db.auth_user.id ==auth.user_id).select(db.auth_user.initials).first().initials)) It needs that the user be authentified

[web2py] Re: getting value of field selected

2010-06-08 Thread mdipierro
No but a Rows object can be sliced {{=db(db.auth_user.id==auth.user_id).select(db.auth_user.initials) [0].initials}} [0] is the same as .first() except that .first() returns None on empty Rows. On Jun 8, 4:56 pm, Jean Guy wrote: > Thank you! > > I was trying with index but fall on tuple at last

Re: [web2py] Re: getting value of field selected

2010-06-08 Thread Jean Guy
Thank you! I was trying with index but fall on tuple at last... Like this : {{=db(db.auth_user.id ==auth.user_id).select(db.auth_user.initials).reponse[0][0]}} But tuple can't be sliced... :) Jonhy 2010/6/8 mdipierro > > > On Jun 8, 4:02 pm, Jean Guy wrote: > > Hello, > > > > This : > > > >

[web2py] web2py 1.79.2 is OUT

2010-06-08 Thread mdipierro
It basically the same as before but it addressed this issue: http://groups.google.com/group/web2py/browse_thread/thread/43e46716642fd5d9# Massimo

[web2py] Re: Advice, convert from string storing numbers to autoincrement integer

2010-06-08 Thread mdipierro
I know this horrible but it does solve some of the problems... db.define_table('whopper_seq',Field('dummy')) db.define_table('yourtable',... Field("whopper_id", "integer",compute=lambda r: db.whopper_seq.insert(dummy=None)) ...) On Jun 7, 8:29 pm, Thadeus Burgess wrote: > I have a problem. > >

[web2py] Re: getting value of field selected

2010-06-08 Thread mdipierro
On Jun 8, 4:02 pm, Jean Guy wrote: > Hello, > > This : > > {{=db(db.auth_user.id==auth.user_id).select(db.auth_user.initials).first().initials}} > > Return : > > auth_user.initials INITIALS > > I would have : > > INITIALS > > How can I do it? > > Jonhy

[web2py] Re: Showing Country listing...

2010-06-08 Thread mdipierro
we could convert to unicode and add a file in contrib. Could be useful but we would have to maintain it. On Jun 8, 3:04 pm, Jason Brower wrote: > I wonder if web2py could use this in it's > code...http://opencountrycodes.appspot.com/python/ > Kinda nifty and we could use the code there or the xm

[web2py] Re: Best CSS framework for web2py

2010-06-08 Thread mdipierro
ez-css now comes with web2py, the welcome layout uses it. On Jun 8, 3:03 pm, Salvor Hardin wrote: > I'm looking for a great CSS framework to use with web2py. > > Someone in this group mentioned using Blueprint for typography and ez- > css for layout. > > I'd like to hear recommendations from web2

[web2py] getting value of field selected

2010-06-08 Thread Jean Guy
Hello, This : {{=db(db.auth_user.id==auth.user_id).select(db.auth_user.initials)}} Return : auth_user.initials INITIALS I would have : INITIALS How can I do it? Jonhy

[web2py] Showing Country listing...

2010-06-08 Thread Jason Brower
I wonder if web2py could use this in it's code... http://opencountrycodes.appspot.com/python/ Kinda nifty and we could use the code there or the xml dynamically as it updates every 24 hours. Best Regards, Jason Brower

[web2py] Best CSS framework for web2py

2010-06-08 Thread Salvor Hardin
I'm looking for a great CSS framework to use with web2py. Someone in this group mentioned using Blueprint for typography and ez- css for layout. I'd like to hear recommendations from web2py users. Which is your favorite? If you are unfamiliar with CSS frameworks, check out: * http://www.w3ave

[web2py] Re: get authenticate user id from session

2010-06-08 Thread mdipierro
auth.user_id is the user id retrived from the session. On Jun 8, 1:39 pm, Jean Guy wrote: > Hello web2py geek, > > How can I get the user id from session ? > > Thanks. > > Jonhy

[web2py] get authenticate user id from session

2010-06-08 Thread Jean Guy
Hello web2py geek, How can I get the user id from session ? Thanks. Jonhy

[web2py] Re: tos download

2010-06-08 Thread mdipierro
or better {{=A('terms of service',_href=URL(r=request,c='static',f='cms/files/ tos_fitwise.pdf',vars=dict(attachment=True)))}} On Jun 8, 1:23 pm, mdipierro wrote: > try > > {{=A('terms of service',_href=URL(r=request,c='static',f='cms/files/ > tos_fitwise.pdf?attachment'))}} > > On Jun 8, 1:02 p

[web2py] Re: tos download

2010-06-08 Thread mdipierro
try {{=A('terms of service',_href=URL(r=request,c='static',f='cms/files/ tos_fitwise.pdf?attachment'))}} On Jun 8, 1:02 pm, annet wrote: > In a view I have a link which should enable users to download the > terms of service: > > {{=A('terms of service',_href=URL(r=request,c='static',f='cms/files

[web2py] tos download

2010-06-08 Thread annet
In a view I have a link which should enable users to download the terms of service: {{=A('terms of service',_href=URL(r=request,c='static',f='cms/files/ tos_fitwise.pdf'))}} This opens the tos in the browser window, whereas I would like them to be downloaded into the downloads folder on the user

[web2py] Re: "Last Saved On" field displays "communication error" using HTTPS on Apache2, OpenSSL 0.98k, mod_wsgi, python 2.6.5

2010-06-08 Thread Salvor Hardin
The lastest trunk, revision 689fb804f2 (2010-06-08), fixed the "communication error" on Ubuntu 10.04. Here's what I did: 1. Uninstalled simplejson 2.1.1 in Ubuntu using: "sudo easy_install -m simplejson" 2. Confirmed that "communication error" comes back after uninstall. 3. Cloned web2py trunk

[web2py] Re: Nightly build not updated since 2010-06-05

2010-06-08 Thread mdipierro
oops. the deamon died. I updated it now. On Jun 8, 11:24 am, Salvor Hardin wrote: > The contents of the nightly zip file are dated 2010-06-05. > > Couple of suggestions: >  * date/time of snapshot displayed > athttp://web2py.com/examples/default/download >  * date/time inside unit test log > > I

Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
Thank you very much. First solution works for me. V Utorok, 8. jún 2010 o 08:59 -0700, mr.freeze napísal(a): > Just turn it off after you're done: > > db.table.field.represent = lambda v: v[:10] + '...' > grid = webgrid.WebGrid(...) > output = grid() > db.table.field.represent = None > > Also y

[web2py] Nightly build not updated since 2010-06-05

2010-06-08 Thread Salvor Hardin
The contents of the nightly zip file are dated 2010-06-05. Couple of suggestions: * date/time of snapshot displayed at http://web2py.com/examples/default/download * date/time inside unit test log I'll install mercurial and try the latest trunk today. I'm very excited about web2py. The web2py

[web2py] Re: form[0] insert

2010-06-08 Thread mr.freeze
Just turn it off after you're done: db.table.field.represent = lambda v: v[:10] + '...' grid = webgrid.WebGrid(...) output = grid() db.table.field.represent = None Also you can do: def shorten_field(r,fieldtype, row): if fieldtype=='datarow': find your field and shorten it grid.row_cr

Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
Thanks for your response, I know, but that changes it everythere, even if I display just one record on the page (read of crud). I need to shorten the value of the field only in the grid, so that the grid is not too wide. V Utorok, 8. jún 2010 o 08:28 -0700, mr.freeze napísal(a): > WebGrid uses the

[web2py] Re: form[0] insert

2010-06-08 Thread mr.freeze
WebGrid uses the represent function to display your field. You can do: db.table.field.represent = lambda v: v[:10] + '...' On Jun 8, 10:11 am, Julius Minka wrote: > The default Webgrid doesn't have a separate div for a field. > Is CSS identification only way to access/change the value? > > I trie

Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
The default Webgrid doesn't have a separate div for a field. Is CSS identification only way to access/change the value? I tried this, it doesn't work: tmp=grid()[0][line][9+activity][0][0:10] #this works grid()[0][line][9+activity]['_value']=tmp #this doesn't V Utorok, 8. jún 2010 o 06:20 -07

[web2py] Re: Decoding problem - UTF8

2010-06-08 Thread Felipe
I tried with sqlite, just like you now... and I got test├® from de database... On Jun 8, 11:16 am, mdipierro wrote: > I just run this and it works with sqlite. I did not yet have a chance > to try it with postgresql. > > # -*- coding: utf-8 - > *- > db.define_table('test',Field('name')) > db.t

[web2py] Re: Decoding problem - UTF8

2010-06-08 Thread mdipierro
I just run this and it works with sqlite. I did not yet have a chance to try it with postgresql. # -*- coding: utf-8 - *- db.define_table('test',Field('name')) db.test.insert(name='testé') print db(db.test.id>0).select() and it works fine with me. I cannot reproduce your problem which On Jun 8,

[web2py] Re: Upload Field in GAE

2010-06-08 Thread mdipierro
replace if form.accepts(request.vars, session): with if form.accepts(request.vars, session, dbio=False): the file will be in request.vars.logo.file On Jun 8, 8:02 am, arnaud wrote: > Hello, > > i work with Web2Py on GAE. I try to make a db.insert with > SQLFORM.factory method. > > def

[web2py] Re: form[0] insert

2010-06-08 Thread mdipierro
yes form.element('div#id.class')['_value']=45 On Jun 8, 7:46 am, Julius Minka wrote: > Can this be used to modify a value of an element? > I remember I have tried in the past and I failed. The goal was to > display just first 10 characters of longer field in the WebGrid by > Mr.Freeze. > > Juliu

[web2py] Re: Detect App Admin

2010-06-08 Thread mdipierro
import gluon.fileutils is_logged_in_admin=gluon.fileutils.check_credentials(request) On Jun 8, 7:15 am, Sverre wrote: > Is it possible to detect if a developer is logged in the admin app? > The purpose is to make some parts depending on a developer mode.

[web2py] Re: Problem after upgrading to 1.79.1

2010-06-08 Thread mdipierro
fixed now. On Jun 8, 5:09 am, salbefe wrote: > I have problems too after upgrading via mercurial (changeset 546) this > moorning. > > I get the following errors: > > Traceback (most recent call last): >   File "C:\eclipse\plugins > \org.python.pydev.debug_1.5.7.2010050621\pysrc\pydevd.py", line 9

[web2py] Re: parsehtml

2010-06-08 Thread mdipierro
posting... On Jun 8, 2:30 am, Iceberg wrote: > Hi Massimo, did you include it in your latest commit? If so, I guess > you forget to add a new gluon/decoder.py as well. > > And a side note, I recommend you maintain two web2py environment for > yourself, one for developing and then commit new featu

[web2py] Re: Advice, convert from string storing numbers to autoincrement integer

2010-06-08 Thread mdipierro
On Jun 7, 11:39 pm, Thadeus Burgess wrote: > Legacy systems =) The database was already in place as this, > unfortunately when I migrated from access to postgres I kept the same > schema as I was under a time crunch to get *something* running And > now it bites me in the butt. > > The thing

[web2py] Upload Field in GAE

2010-06-08 Thread arnaud
Hello, i work with Web2Py on GAE. I try to make a db.insert with SQLFORM.factory method. def test(): form = SQLFORM.factory( Field('logo','upload')) if form.accepts(request.vars, session): new_domain = db.domain.insert(logo = request.vars.logo) response.flash='cool' el

Re: [web2py] Re: form[0] insert

2010-06-08 Thread Julius Minka
Can this be used to modify a value of an element? I remember I have tried in the past and I failed. The goal was to display just first 10 characters of longer field in the WebGrid by Mr.Freeze. Julius V Pondelok, 7. jún 2010 o 23:32 -0700, annet napísal(a): > Massimo, > > Indeed it was easier to

[web2py] Re: Decoding problem - UTF8

2010-06-08 Thread Felipe
xmlrpclib.Fault: :'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)"> same problem ... On Jun 7, 3:17 pm, mdipierro wrote: > hmmm, please try > > bd[tab].insert(nome=u'testé') > > or > > bd[tab].insert(nome='testé'.encode('utf8')) > > On Jun 7, 9:49 am, Felipe wrot

[web2py] Re: fastcgi install not working

2010-06-08 Thread Cory Coager
Answering my own question, the host provider didn't have mod_fcgid enabled.

[web2py] Detect App Admin

2010-06-08 Thread Sverre
Is it possible to detect if a developer is logged in the admin app? The purpose is to make some parts depending on a developer mode.

[web2py] Re: Layout of functions with the MVC environment

2010-06-08 Thread Yarko Tymciurak
On Jun 8, 6:27 am, eddie wrote: > I've been considering some issues related to this. Where do people > tend to locate their functions they are calling from controllers? You can locate controller specific functions in your controller file; > > Obviously the simplest place is as a function defined

[web2py] Re: "Last Saved On" field displays "communication error" using HTTPS on Apache2, OpenSSL 0.98k, mod_wsgi, python 2.6.5

2010-06-08 Thread Lisandro Rostagno
Thanks! I tried installing python-setuptools and simplejson, and it worked! (I was having the problem on Ubuntu 9.10, with the development server). I only executed this commands: sudo aptitude install python-setuptools sudo easy_install simplejson And now everything works just fine. Thanks again!

[web2py] Re: Ajax style calls blocking

2010-06-08 Thread eddie
Thanks for the feedback, the session._unlock(response) call did the trick. It does raise a question for me though. Is it so uncommon for people to hit the server with a couple of lengthy ajax calls from a single page, that the solution to allowing them to run them in parallel is not really adverti

[web2py] Re: Layout of functions with the MVC environment

2010-06-08 Thread eddie
I've been considering some issues related to this. Where do people tend to locate their functions they are calling from controllers? Obviously the simplest place is as a function defined in the same controller python file as where it is called from. But some down sides to this are: * You end up w

[web2py] Re: Problem after upgrading to 1.79.1

2010-06-08 Thread salbefe
I have problems too after upgrading via mercurial (changeset 546) this moorning. I get the following errors: Traceback (most recent call last): File "C:\eclipse\plugins \org.python.pydev.debug_1.5.7.2010050621\pysrc\pydevd.py", line 978, in debugger.run(setup['file'], None, None) File "

[web2py] Re: python web console

2010-06-08 Thread Iceberg
Massimo and Yarko, Thanks for your concern. So I trace it down. The result is ... interesting. I guess you both are right, the last few lines of current gluon/ languages.py already fall back to original source language, like this: def translate(self, message, symbols): mt = self.t.ge

[web2py] Re: Problem after upgrading to 1.79.1

2010-06-08 Thread Sverre
Solved according to this thread: http://groups.google.no/group/web2py/browse_thread/thread/43e46716642fd5d9 On 8 Jun, 08:44, Sverre wrote: > Ok, I installed 1.77.3 and all is working. But with the current > version I get communication errors. My python version is 2.6.4 on > Ubuntu 10.04. How can

[web2py] web shell problem

2010-06-08 Thread mika
Hello! I have trouble with running web shell. In app admin, when I choose "shell" I get: Traceback (most recent call last): File "path_to_app/web2py/gluon/main.py", line 381, in wsgibase serve_controller(request, response, session) File "path_to_app/web2py/gluon/main.py", line 154, in ser

[web2py] Re: parsehtml

2010-06-08 Thread Iceberg
Hi Massimo, did you include it in your latest commit? If so, I guess you forget to add a new gluon/decoder.py as well. And a side note, I recommend you maintain two web2py environment for yourself, one for developing and then commit new features, the other is used for "hg pull" and "hg update" and