[web2py] Importing a large file

2010-01-08 Thread Jason Brower
I have data like this in a csv file Color Name, Base, Colorant, Amount, Colorant, Amount, Colorant, Amount, Colorant, Amount, Colorant, Amount 10 PORDRR,G,fo1,76,da1,32,ro1,111,yi1,1,, It is for a paint database. Is it at all possible to import that into this model? Normally I would just take

[web2py] Re: Importing a large file

2010-01-08 Thread mdipierro
Something like this? import csv reader = csv.reader(csvfile) header = None paints = {} colorants = {} for line in reader: if not header: header = line else: row = dict([header[i],item) for i,item in enumerate(line)]) name = row['Color Name'] colorant =

Re: [web2py] Re: represent

2010-01-08 Thread KONTRA, Gergely
Since the patch is about 2 lines of code, does it make sense to have a represent for tables, similar for fields, so that I could write something like: db.post.represent = lambda row: row['title'], which means the same as using format='%(title)s' on define_table? thx Gergo On Thu, Jan 7, 2010 at

[web2py] AttributeError: 'module' object has no attribute 'mkdir'

2010-01-08 Thread v
Hi Massimo, I was trying the web2py Auth module on GAE and while everything else seems to work fine, the change_password function throws up this error; works fine on localhost. Looks like there's an attempt to create directory in sql.py; ofcourse, mkdir isn't supported on GAE, hence the error.

[web2py] Re: represent

2010-01-08 Thread mdipierro
Here is the problem. Perhaps you have a solution. format is used to represent a record in a reference as a select/ option. Probably you have many of these records and you only want to fetch columns that are necessary to build the representation. By using format='%(first_name)s %(last_name)s' web

[web2py] Re: AttributeError: 'module' object has no attribute 'mkdir'

2010-01-08 Thread mdipierro
Which web2py version? On Jan 8, 5:42 am, v vishal...@gmail.com wrote: Hi Massimo, I was trying the web2py Auth module on GAE and while everything else seems to work fine, the change_password function throws up this error; works fine on localhost.  Looks like there's an attempt to create

[web2py] Re: AttributeError: 'module' object has no attribute 'mkdir'

2010-01-08 Thread mdipierro
I think the problem is that your app is missing a databases folder. Since you never run it locally without GAE it was never created. Can you verify? Massimo On Jan 8, 5:42 am, v vishal...@gmail.com wrote: Hi Massimo, I was trying the web2py Auth module on GAE and while everything else seems

[web2py] Re: AttributeError: 'module' object has no attribute 'mkdir'

2010-01-08 Thread mdipierro
I think the version i just uploaded to trunk should skip the os.mkdir () On Jan 8, 6:16 am, mdipierro mdipie...@cs.depaul.edu wrote: I think the problem is that your app is missing a databases folder. Since you never run it locally without GAE it was never created. Can you verify? Massimo

Re: [web2py] Re: represent

2010-01-08 Thread KONTRA, Gergely
Well, then let the function accepts not a row, but an id, which is the pk of the row. On Fri, Jan 8, 2010 at 13:01, mdipierro mdipie...@cs.depaul.edu wrote: Here is the problem. Perhaps you have a solution. format is used to represent a record in a reference as a select/ option. Probably you

[web2py] Re: represent

2010-01-08 Thread mdipierro
What do you want to do with it? Are you planning to fecth one record at the time for every record in all possible references? I would not recommend it. I am not saying no to your proposal of a represent function. I am just saying we need to think it over more. In the end what you want (and makes

[web2py] What's the recommended approach to using lower on fields on GAE?

2010-01-08 Thread Carl
hi, Locally, on sqlite I am using the following calls to determine if a team name already exists in a database fine: in a constructor: self.db = db in a class method: n = self.db(self.db.team.name.lower() == name.lower()).count() when run on dev_appserver (GAE) self.db.team.name.lower() throws

[web2py] Re: [web2py:38396] Re: represent

2010-01-08 Thread Alexandre Andrade
to a specific field to show on table, it works to me with: Field('codigo', requires = IS_IN_DB(db, 'natureza_despesa.id', '%(codigo)s - %(especificacao)s'), represent= lambda codigo: db.natureza_despesa[codigo].codigo + ' - ' +

[web2py] simple way to update modified_on field

2010-01-08 Thread Miguel Lopes
In many models I have the following field definitions: ... Field('created_by',db.auth_user,default=me,writable=False), Field('created_on','datetime',default=request.now,writable=False), Field('modified_by',db.auth_user, default=me),

Re: [web2py] Re: represent

2010-01-08 Thread KONTRA, Gergely
First, I am not debugging the code, just browsing it, and found that: def sqlhtml_validators(field): Field type validation, using web2py's validators mechanism. makes sure the content of a field is in line with the declared fieldtype field_type, field_length =

[web2py] Re: [web2py:38394] Re: SQLFORM without tables

2010-01-08 Thread Alex Fanjul
This is the most recurrent topic I think. It should be called Decoupled, Custom and Tableless Forms. I'd say it would involve lot of changes for default things that web2py does now very well, and that is the problem. Alex F El 06/01/2010 0:13, Thadeus Burgess escribió: I think what he really

[web2py] Re: Importing a large file

2010-01-08 Thread Brian M
I have been working on using web2py to import csv files and find that in general it works very well. You will need to be careful with pulling in the colorant and amount fields - if you use the csv.DictReader() to refer to columns in the CSV file by name instead of index you'll find that you only

[web2py] Re: represent

2010-01-08 Thread mdipierro
If I understand what you need, your problem is representing a record (not a specific field) in SELECT/OPTION when creating/updating a record in a different table that references this one. If this the case, the list of options is built by the IS_IN_DB validator. It looks at the format string,

[web2py] Re: simple way to update modified_on field

2010-01-08 Thread mdipierro
Replace Field('modified_by',db.auth_user, default=me), Field ('modified_on','datetime',default=request.now,writable=False)) with Field('modified_by',db.auth_user, update=me), Field ('modified_on','datetime',update=request.now,writable=False)) then you do not need update_record

[web2py] Re: Built-in Webserver

2010-01-08 Thread mdipierro
The keepalive weirdness is gone when we upgraged to a more recent version of wsgiserver. Some time ago. The only known limitation of the current web server is failure of ssl for large uploads (and perhaps downloads?). I run it in production. Anyway, Tim, here is working on a new web server called

[web2py] Re: Built-in Webserver

2010-01-08 Thread mdipierro
I do not know what fassimoster means. I meant to type faster but something weird happened to my editor window. On Jan 8, 11:28 am, mdipierro mdipie...@cs.depaul.edu wrote: The keepalive weirdness is gone when we upgraged to a more recent version of wsgiserver. Some time ago. The only known

Re: [web2py] Re: Built-in Webserver

2010-01-08 Thread Alex Fanjul
ajjajaja very nice Massimo... you are trying to invent some new adjetives for web2py! Alex El 08/01/2010 18:30, mdipierro escribió: I do not know what fassimoster means. I meant to type faster but something weird happened to my editor window. On Jan 8, 11:28 am,

[web2py] Re: manually saving files

2010-01-08 Thread weheh
Hi Massimo, one more thing. My 'upload' field named filename is getting uploaded to no_table.filename.x1yas234...etc., where the x1yas234...etc. is the crypto part of the filename. I'm expecting the filename to be doc.filename.x1yas234...etc. Why is this happening and how do I get it to do the

Re: [web2py] Re: Built-in Webserver

2010-01-08 Thread Timothy Farrell
My motivation for developing Rocket wasn't speed as much as it was concurrency. wsgiserver drops to 9% of its max throughput when processing 25 concurrent connections and that drop continues downward as more concurrent connections happen**. In contrast, Rocket drops to 53% of its max at 25

[web2py] Re: Built-in Webserver

2010-01-08 Thread cjrh
On Jan 8, 8:46 pm, Timothy Farrell tfarr...@swgen.com wrote: I am still interested to know if anyone uses web2py without an external webserver. I do, on an intranet app for serving automated builds. Very low concurrency (theoretical maximum of 12 simultaneous connections :). -- You received

[web2py] Re: www.web2py.com down?

2010-01-08 Thread mdipierro
Sorry I just rebooted the server. Massimo On Jan 8, 1:35 pm, Gavin Joyce gavinjo...@gmail.com wrote: Hi, I've been researching frameworks for GAE and am excited about using web2py. I was hoping to play around with it today but the website has been down all day for me (503 Service

[web2py] Re: www.web2py.com down?

2010-01-08 Thread Gavin Joyce
Thanks Massimo On Jan 8, 7:46 pm, mdipierro mdipie...@cs.depaul.edu wrote: Sorry I just rebooted the server. Massimo On Jan 8, 1:35 pm, Gavin Joyce gavinjo...@gmail.com wrote: Hi, I've been researching frameworks for GAE and am excited about using web2py. I was hoping to play

[web2py] Re: What's the recommended approach to using lower on fields on GAE?

2010-01-08 Thread Carl
Ah! GAE doesn't support lower() http://osdir.com/ml/web2py/2009-10/msg00625.html On Jan 8, 1:06 pm, Carl carl.ro...@gmail.com wrote: hi, Locally, on sqlite I am using the following calls to determine if a team name already exists in a database fine: in a constructor: self.db = db in a

[web2py] Re: manually saving files

2010-01-08 Thread weheh
Massimo, thanks for your continuing support on this issue. I am trying this on an uploaded file (not the textarea input): db.doc.insert(filename=db.doc.filename.store(stream,'filename')) but I'm getting the ticket filename=db.doc.filename.store(stream,'filename') NameError: global name

[web2py] Re: manually saving files

2010-01-08 Thread weheh
Massimo, thanks for your continued support on this issue. I'm still having trouble. I'm doing this to store an uploaded file: db.doc.insert(filename=db.doc.filename.store (request.vars.filename.file,request.vars.filename.filename)) where doc is a table with ... Field('filename','upload') ...

[web2py] Unladen Swallow: Python 3’s Best Feature.

2010-01-08 Thread mikech
PEP due out soon proposing rolling Unladen Swallow into Python 3 http://jessenoller.com/2010/01/06/unladen-swallow-python-3s-best-feature/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to

Re: [web2py] Unladen Swallow: Python 3’s Best Feat ure.

2010-01-08 Thread Timothy Farrell
I LOL'ed at that picture so hard! On 1/8/2010 3:33 PM, mikech wrote: PEP due out soon proposing rolling Unladen Swallow into Python 3 http://jessenoller.com/2010/01/06/unladen-swallow-python-3s-best-feature/ -- You received this message because you are subscribed to the Google Groups

[web2py] Re: What's the recommended approach to using lower on fields on GAE?

2010-01-08 Thread mdipierro
http://groups.google.com/group/google-appengine-python/browse_thread/thread/ceebac3397625019/e2682c5ba67ce48e?lnk=gstq=lower#e2682c5ba67ce48e On Jan 8, 3:08 pm, Carl carl.ro...@gmail.com wrote: Ah! GAE doesn't support lower()http://osdir.com/ml/web2py/2009-10/msg00625.html On Jan 8, 1:06 pm,

[web2py] Re: manually saving files

2010-01-08 Thread mdipierro
I need to look at the complete action. I suspect you have SQLFORM.factory somewhere that is interefring with the process. On Jan 8, 3:31 pm, weheh richard_gor...@verizon.net wrote: Massimo, thanks for your continued support on this issue. I'm still having trouble. I'm doing this to store an

Re: [web2py] Re: What's the recommended approach to using lower on fields on GAE?

2010-01-08 Thread Carl
Thanks M; I'll have a look at your new solution. Any performance issues that you know of? On Friday, January 8, 2010, mdipierro mdipie...@cs.depaul.edu wrote:

Re: [web2py] Re: Built-in Webserver

2010-01-08 Thread Thadeus Burgess
I would never use the built in server for production. I will stick it on a linux server, running apache to server web2py and nginx to serve static files. I'm an extremest, and will use the fastest configuration possible for every situation, and don't see any situation where I would use the

Re: [web2py] Re: www.web2py.com down?

2010-01-08 Thread Thadeus Burgess
The server keeps going down even after disabling cron, were you able to figure out why ? -Thadeus On Fri, Jan 8, 2010 at 1:46 PM, Gavin Joyce gavinjo...@gmail.com wrote: Thanks Massimo On Jan 8, 7:46 pm, mdipierro mdipie...@cs.depaul.edu wrote: Sorry I just rebooted the server. Massimo

[web2py] Re: www.web2py.com down?

2010-01-08 Thread mdipierro
This time I was able to see the error. It was an out of memory error on os.fork. This is a virtual machine with 256MB Ram and I had not rebooted in long time (only restarted the web server). I rebooted it now and let's see what happens. Massimo On Jan 8, 4:26 pm, Thadeus Burgess

Re: [web2py] Re: Importing a large file

2010-01-08 Thread Jason Brower
I tried the script but couldn't get through the syntax error. Sorry, lots of commands I don't know there. :/ BR, Jason On Fri, 2010-01-08 at 09:17 -0800, Brian M wrote: I have been working on using web2py to import csv files and find that in general it works very well. You will need to be

[web2py] Looking for web2py, jQuery, AJAX contractors

2010-01-08 Thread weheh
This isn't 100% definite yet, but I'm about to win a significant long- term web2py contract and I need to build a team of 2 additional developers strong in web2py, jQuery, AJAX, css, and google apps. Strong design sense is a plus. The project will most likely begin within a month. If you are

[web2py] Re: Importing a large file

2010-01-08 Thread Brian M
Jason, What's the syntax error? Try this, it's untested but should be verbose enough to get you there. If you have trouble perhaps provide a sample file (few dozen records) that we can test against. import csv paint_formulas = csv.reader(csvfile) header = None #variable to store the paints we've

[web2py] Re: Looking for web2py, jQuery, AJAX contractors

2010-01-08 Thread mdipierro
Congratulations On Jan 8, 10:28 pm, weheh richard_gor...@verizon.net wrote: This isn't 100% definite yet, but I'm about to win a significant long- term web2py contract and I need to build a team of 2 additional developers strong in web2py, jQuery, AJAX, css, and google apps. Strong design

[web2py] DataTables server-side processing on GAE?

2010-01-08 Thread toan75
Hi all, I deploy a DataTables server-side processing on GAE (http:// toan75.appspot.com/init/default/view_table) , it's not work but it work fine on local (http://localhost:8080/init/default/view_table) or example non server-side (http://toan75.appspot.com/init/default/ table). It expects a JSON

[web2py] Current List Of Web2py Plugins

2010-01-08 Thread Thadeus Burgess
Ok here is a list as I know it. I need some help sorting out what is what. The files have been obtained by scanning through old posts, so I might have an older version of your plugin. Also, for plugins that do not have a username attached, that means that we would like the plugins, but currently

[web2py] Share some wisdom

2010-01-08 Thread Thadeus Burgess
I am a young programmer. The thought of managing a semi-large application seems a bit... daunting to me. I was hoping some older programmers, and those with experience managing projects that were either large, or had multiple developers work on, could share some insights with me. Here are some of

[web2py] Re: Share some wisdom

2010-01-08 Thread Thadeus Burgess
Along with this. Say I have multiple projects that share the similar data. So for my blog I have a comments plugin. For PluginCentral, I also use the same comments plugin. What is the best way to manage this comments plugin, so that I can make changes to the plugin from either app and have the

Re: [web2py] Re: Importing a large file

2010-01-08 Thread Jason Brower
It is much more understandable. But it seems that the name paint_formulas is not defined. What is supposed to be populated there? Best Regards, Jason On Fri, 2010-01-08 at 20:43 -0800, Brian M wrote: Jason, What's the syntax error? Try this, it's untested but should be verbose enough to get

Re: [web2py] Share some wisdom

2010-01-08 Thread Jason Brower
On Fri, 2010-01-08 at 23:56 -0600, Thadeus Burgess wrote: I am a young programmer. The thought of managing a semi-large application seems a bit... daunting to me. I was hoping some older programmers, and those with experience managing projects that were either large, or had multiple