[web2py] Re: Database performance

2011-08-25 Thread Massimo Di Pierro
Try by replacing {{rows = dataSet.select()}} with {{rows = db.executesql(dataSet._select())}} and tell me what get. Anyway, your raw sql select is only feting a third of the rows that that web2py is fetching. web2py is also doing a lot of extra work converting the list of records from

[web2py] Re: Database performance

2011-08-25 Thread HughBarker
Thanks for the reply. {{rows = db.executesql(dataSet._select())}} executes in 0.16s. On Aug 26, 2:09 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Try by replacing  {{rows = dataSet.select()}} with  {{rows = db.executesql(dataSet._select())}} and tell me what get. Anyway,

[web2py] Re: Database drivers lost

2011-08-05 Thread Massimo Di Pierro
You may have two python versions and one of them does not have sqlite. On Aug 4, 10:06 pm, Matthew matthew.g.nor...@gmail.com wrote: I ran a functioning application using App Engine once. When I tried to run it again without GAE, I noticed that only the goolgle database driver was available

[web2py] Re: Database auditing - comments please

2011-07-25 Thread nick name
Newer version attached, has been tested in one specific app which brought up some issues with tables that have references to them (these have been fixed). Now patches instance instead of class (so web2py's normal reloading works equally well) Massimo / Jonathan - could you comment on the

[web2py] Re: database replication

2011-07-22 Thread Nils Olofsson
Hi, I'm still not sure as to how to go about using this. Say, I have a controller with the function list: and a function called write: if the function is list then read from slaves, if the function is write, write to master. So the correct code should be: if request.function in

[web2py] Re: database replication

2011-07-22 Thread Anthony
You could define 'read_only_actions' anywhere it makes sense, for example: read_only_actions = ['list','another_read_action','yet_another_read_action'] if request.function in read_only_actions: db =... ... else db = Of course, if that one 'if' statement is the only place you

[web2py] Re: database replication

2011-07-22 Thread Nils Olofsson
Hi, I did something similar, if add in request.function: db = DAL(['mysql://Database connection string']) else: print Using Slave Database db = DAL(shuffle(['database connection string']) That would and uses the slave database (readonly) but, I get this error message.

[web2py] Re: database replication

2011-07-22 Thread Anthony
Have all the tables already been created in the slave databases (web2py may be trying to create tables or run migrations)? What happens if you do: db = DAL(shuffle(['connection string']), migrate_enabled=False) Anthony On Friday, July 22, 2011 9:28:40 AM UTC-4, Nils Olofsson wrote: Hi, I

Re: [web2py] Re: database replication

2011-07-22 Thread nils
Hi Anthony, That worked, maybe the docs should be updated. I did try migrate=False, thought they were both the same thing. Regards, Nils On Fri, Jul 22, 2011 at 3:05 PM, Anthony abasta...@gmail.com wrote: Have all the tables already been created in the slave databases (web2py may be trying

Re: [web2py] Re: database replication

2011-07-22 Thread Anthony
On Friday, July 22, 2011 10:12:01 AM UTC-4, nils wrote: Hi Anthony, That worked, maybe the docs should be updated. Indeed. I did try migrate=False, thought they were both the same thing. migrate=False (as an argument to DAL) doesn't turn off migrations -- it merely determines the

Re: [web2py] Re: database replication

2011-07-22 Thread nils
Hi Anthony, yes, migrate is set for fields in the aut table. Also another note, shuffle did not work for me I have to, from random import sample. then change DAL(sample(['mysql connection string','mysql connection string'],1),migrate_enabled=False) Regards, Nils On Fri, Jul 22, 2011 at 4:02

Re: [web2py] Re: database replication

2011-07-22 Thread Anthony
On Friday, July 22, 2011 12:28:24 PM UTC-4, nils wrote: Hi Anthony, yes, migrate is set for fields in the aut table. Also another note, shuffle did not work for me I have to, from random import sample. then change DAL(sample(['mysql connection string','mysql connection

Re: [web2py] Re: database replication

2011-07-22 Thread Anthony
Just changed the book example to use random.sample. Anthony On Friday, July 22, 2011 12:55:46 PM UTC-4, Anthony wrote: On Friday, July 22, 2011 12:28:24 PM UTC-4, nils wrote: Hi Anthony, yes, migrate is set for fields in the aut table. Also another note, shuffle did not work for me

[web2py] Re: database replication

2011-07-21 Thread Massimo Di Pierro
You would only use this if you have a replicated database. I.e. you are running many database servers synced with each other. For example: http://en.wikipedia.org/wiki/Multi-master_replication On Jul 21, 12:44 pm, Nils Olofsson nils.olofs...@gmail.com wrote: Hi, I see this in the

[web2py] Re: database replication

2011-07-21 Thread Nils Olofsson
Hi Massimo, I'm testing amazon's RDS and EC2 , 1 master many slaves. I could not find out where exactly I am suppose to be putting this code. Regards, Nils On Jul 21, 6:48 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You would only use this if you have a replicated database. I.e.

[web2py] Re: database replication

2011-07-21 Thread Anthony
It would go in your model file -- the same place where you would normally define the db connection. Anthony On Thursday, July 21, 2011 2:29:45 PM UTC-4, Nils Olofsson wrote: Hi Massimo, I'm testing amazon's RDS and EC2 , 1 master many slaves. I could not find out where exactly I am

[web2py] Re: database replication

2011-07-21 Thread Nils Olofsson
Hi, I did this but i got : Traceback (most recent call last): File /var/www/web2py/gluon/restricted.py, line 192, in restricted exec ccode in environment File /var/www/web2py/applications/Event/models/db.py, line 18, in module if request.action in read_only_actions: NameError: name

[web2py] Re: database replication

2011-07-21 Thread Anthony
That's just some (incomplete) example code. You have to define 'read_only_actions' yourself. In that example, it would be a list functions that only need to read (but not write) the database and can therefore be given access to one of the slave databases. Actually, it looks like the code has

[web2py] Re: Database connection to Google Datastor in appengine

2011-07-14 Thread Anthony
On Thursday, July 14, 2011 7:48:40 AM UTC-4, stargate wrote: I am having trouble finding the connection string example to connect to a Google Datastor database. See http://code.google.com/p/web2py/source/browse/applications/welcome/models/db.py#8. According to the book, you can just use

[web2py] Re: Database connection to Google Datastor in appengine

2011-07-14 Thread stargate
Thanks for the info I will try that. On Jul 14, 8:09 am, Anthony abasta...@gmail.com wrote: On Thursday, July 14, 2011 7:48:40 AM UTC-4, stargate wrote: I am having trouble finding the connection string example to connect to a Google Datastor database.

[web2py] Re: database

2011-06-09 Thread Massimo Di Pierro
Not sure if you have a question for us. Good to have you on board :-) On Jun 9, 7:54 am, anil manikyam anilmanikya...@gmail.com wrote: created in html login: password: when i entered the submit button it compare with the  values in database. if correct go to another page send the web2py

[web2py] Re: database

2011-06-09 Thread Anthony
On Thursday, June 9, 2011 8:54:07 AM UTC-4, anil manikyam wrote: created in html login: password: when i entered the submit button it compare with the values in database. if correct go to another page send the web2py code 2 my email Are you asking how to do this? If so, look at

[web2py] Re: database access

2011-06-09 Thread pbreit
We might more detail about what you are trying to do including some code samples.

[web2py] Re: Database Migration from sqlite to postgresql

2011-05-26 Thread Massimo Di Pierro
Run this script then change the DB URI to postgresql http://code.google.com/p/web2py/source/browse/scripts/cpdb.py On May 26, 1:15 am, web2all chinnag.li...@gmail.com wrote: Dear All, I'm planning to migrate my database to postgresql from sqlite. I dont know how to do it, any body tell me

[web2py] Re: Database

2011-03-25 Thread DenesL
Please post a sample of your table definitions and use them to explain what is your desired result. On Mar 25, 3:25 am, Rupesh vipreshs...@gmail.com wrote: hi everyone. i have a one problem with database. i want use one of my column into another table. i know i can do it with the help of

[web2py] Re: Database fieldname convention

2011-03-07 Thread StUStD
I found out, the problem is not in the numeric part of the names, rather, names containing uppercase letters cause the problem. Again, is it convention that database field names should be lowercase? On Mar 7, 9:46 am, StUStD hjansen...@gmail.com wrote: I experience inserting and updating

[web2py] Re: Database fieldname convention

2011-03-07 Thread villas
I think it depends on the DB. If you always make your fields lower case in web2py, there is a much better chance they will always work consistently across all DBs. Perhaps not so much a convention, but more 'good practice'. On Mar 7, 9:15 am, StUStD hjansen...@gmail.com wrote: I found out,

[web2py] Re: Database fieldname convention

2011-03-07 Thread Kevin Ivarsen
Hello, I recently ran into this problem as well - field names with uppercase characters were ignored in SQLFORM inserts/updates. Luckily, I found that the behavior is fixed in the latest 1.93.2 release of web2py. Try upgrading and see if that solves the problem. Kevin On Mar 7, 4:15 am, StUStD

[web2py] Re: database access

2011-02-17 Thread villas
You can use ANY suitable tool to examine/administrate your DB independently of web2py. On Feb 17, 4:04 am, stargate kyoukh...@gmail.com wrote: It's just a database admin tool for mysql.  I just want to be able to access the mysql lite database that comes with web2py using mysqlfront On Feb

[web2py] Re: database access

2011-02-17 Thread stargate
So saying that how do I add a username and password to the database and give the user permissions to insert delete view records. I also what to be able to connect to the database using a db tool to examine and administrate my db. Which one would you recommend. On Feb 17, 7:15 am, villas

[web2py] Re: database access

2011-02-17 Thread villas
Well I try to only use DB admin tools to examine the data and occasionally edit it and perhaps create and optimise indexes etc, usually once my app is stable. Bear in mind that anything you do in a DB admin tool will make it more difficult to migrate your app to another database, so try to

[web2py] Re: database access

2011-02-17 Thread stargate
So its better to start with a mySQl database and connect to that database then using the mysql lite database. What I like is out of the box web2py has a user login now is it possible to export that login structure to a mysql database and what file would i have to change in web2py so it will

[web2py] Re: database access

2011-02-17 Thread stargate
Is there a example on how to do this. Thanks for all the help On Feb 17, 11:50 am, stargate kyoukh...@gmail.com wrote: So its better to start with a mySQl database and connect to that database then using the mysql lite database.  What I like is out of the box web2py has a user login now is

[web2py] Re: database access

2011-02-16 Thread stargate
Is it possible to do this On Feb 16, 9:51 am, stargate kyoukh...@gmail.com wrote: When running web2py how do i access the mysql database using a applicaiton like http://www.mysqlfront.de/wp/download/ Also when creating a new application using the application wizard it has no indication to

Re: [web2py] Re: database access

2011-02-16 Thread Richard Vézina
I think you should provide information about mysqlfront and how you think it could work with Web2py. Personnaly I am not aware of anything about mysqlfront... Richard On Wed, Feb 16, 2011 at 9:40 PM, stargate kyoukh...@gmail.com wrote: Is it possible to do this On Feb 16, 9:51 am, stargate

[web2py] Re: database access

2011-02-16 Thread stargate
It's just a database admin tool for mysql. I just want to be able to access the mysql lite database that comes with web2py using mysqlfront On Feb 16, 10:22 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: I think you should provide information about mysqlfront and how you think it could

Re: [web2py] Re: Database data in layout?

2011-02-08 Thread Vasile Ermicioi
take a look at response.menu you can change it in any controller also you can set any other variable the same way response.yourvar = ...

[web2py] Re: Database data in layout?

2011-02-07 Thread pbreit
Any ideas?

[web2py] Re: Database data in layout?

2011-02-07 Thread pbreit
Yet again, I am mistaken. It does indeed look like templates all get jammed together before the code is executed. I was getting some unexpected errors which caused me to wonder.

[web2py] Re: Database administrator not showing records

2010-12-29 Thread mdipierro
What version did you upgrade from? Did it work before with the same data? On Dec 29, 7:00 pm, Maurice Ling mauricel...@gmail.com wrote: Hi I've upgraded to version 1.91.5 and noticed an issue with the database administrator. I was in the admin application of my application

[web2py] Re: Database administrator not showing records

2010-12-29 Thread Maurice Ling
It was working on 1.82.1 on the same data. On Dec 30, 9:10 am, mdipierro mdipie...@cs.depaul.edu wrote: What version did you upgrade from? Did it work before with the same data? On Dec 29, 7:00 pm, Maurice Ling mauricel...@gmail.com wrote: Hi I've upgraded to version 1.91.5 and noticed

[web2py] Re: Database administrator not showing records

2010-12-29 Thread Maurice Ling
Sorry. Still worked on 1.83.2. On Dec 30, 9:29 am, Maurice Ling mauricel...@gmail.com wrote: It was working on 1.82.1 on the same data. On Dec 30, 9:10 am, mdipierro mdipie...@cs.depaul.edu wrote: What version did you upgrade from? Did it work before with the same data? On Dec 29, 7:00 

[web2py] Re: Database administrator not showing records

2010-12-29 Thread mdipierro
No idea. Can you send me (confidetially) your app and your db (if it is sqlite)? On Dec 29, 7:30 pm, Maurice Ling mauricel...@gmail.com wrote: Sorry. Still worked on 1.83.2. On Dec 30, 9:29 am, Maurice Ling mauricel...@gmail.com wrote: It was working on 1.82.1 on the same data. On Dec

[web2py] Re: Database administrator not showing records

2010-12-29 Thread Maurice Ling
Hi Massimo Just sent to you. ML On Dec 30, 9:33 am, mdipierro mdipie...@cs.depaul.edu wrote: No idea. Can you send me (confidetially) your app and your db (if it is sqlite)? On Dec 29, 7:30 pm, Maurice Ling mauricel...@gmail.com wrote: Sorry. Still worked on 1.83.2. On Dec 30, 9:29 

[web2py] Re: Database administrator not showing records

2010-12-29 Thread mdipierro
Thank you. This fixes your problem: cp applications/welcome/views/appadmin.html applications/testcynote/ views/ cp applications/welcome/controllers/appadmin.py applications/ testcynote/controllers/ There was a bug fix in appadmin (do not recall) that caused this issue. BTW... this is some neat

[web2py] Re: Database administrator not showing records

2010-12-29 Thread Maurice Ling
Thanks Massimo However, I am not able to install the 3rd party packages into web2py/ site-packages - it goes into my Python directory. On Dec 30, 12:13 pm, mdipierro mdipie...@cs.depaul.edu wrote: Thank you. This fixes your problem: cp applications/welcome/views/appadmin.html

[web2py] Re: database query

2010-12-22 Thread czamb
Massimo, thanks for the quick reply, seems to work :) Regards czamb On 22 Dez., 02:21, mdipierro mdipie...@cs.depaul.edu wrote: If you have joins, I would do this:

[web2py] Re: database query

2010-12-21 Thread mdipierro
If you have joins, I would do this: movies_with_activeTag=db(db.movies.id.belongs(db(db.link.tagID==id_of_activeTag)._select(db.link.movieID,groupby=db.link.movieID,orderby=db.link.movieID))).select() On Dec 21, 7:00 pm, czamb grossep...@googlemail.com wrote: This should be an easy one, but I

[web2py] Re: Database query using regular expressions

2010-11-04 Thread mdipierro
This may work query=regexp_replace(lower(titel), '[ -,.:]', '', 'g') = regexp_replace(lower('SAMj -South african Medical Journal'), '[,.:]', '', 'g') db(query).select(db.joernaal.titel) On Nov 4, 5:14 am, Johann Spies johann.sp...@gmail.com wrote: In order to solve inconsistent typing by

Re: [web2py] Re: Database query using regular expressions

2010-11-04 Thread Johann Spies
Thanks. I will try it. Regards Johann --  May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord!  His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and

[web2py] Re: Database JOIN on more than 2 tables

2010-10-04 Thread annet
Hi Alex, Here's how you join more than two tables in web2py: db((db.table1.col == db.table2.FKcol)(db.table1col == db.table3.FKcol)).select() Kind regards, Annet.

[web2py] Re: Database JOIN on more than 2 tables

2010-10-04 Thread Alex
Thank you very much! So obvious (as it always is once you see the answer) :). Thanks again! On Oct 4, 12:50 am, annet annet.verm...@gmail.com wrote: Hi Alex, Here's how you join more than two tables in web2py: db((db.table1.col == db.table2.FKcol)(db.table1col ==

[web2py] Re: database question

2010-09-24 Thread annet
I guess you're looking for something like this: In db_00.py: db.define_table('stores', Field('name'), migrate='stores.table') db.define_table('regions', Field('abbr',length=2), migrate='regions.table') db.define_table('store_region', Field('store_id',db.stores),

[web2py] Re: database question

2010-09-24 Thread ron_m
If a store can only be in one region then you don't need a many to many relation expressed by intermediate table store_region. Instead just put a region_id field in store referencing the region table forming a one to many relation from region to store. You may have a reason for a many to many

[web2py] Re: database variable scoping and visibility

2010-08-16 Thread mdipierro
Here is how I handled in the past. In a model file: def bydb(name=None): if name: session.db_name=name else: name=session.db_name commdb=DAL(name) commdb.define_table(.) commdb.define_table(.) commdb.define_table(.) return commdb and use it

[web2py] Re: database variable scoping and visibility

2010-08-16 Thread david.waldrop
beautiful. it worked perfectly. Thank you. Again :-) On Aug 16, 2:27 pm, mdipierro mdipie...@cs.depaul.edu wrote: Here is how I handled in the past. In a model file: def bydb(name=None):       if name: session.db_name=name       else: name=session.db_name       commdb=DAL(name)      

[web2py] Re: database cannot be modified anymore : migration between v1.44 current.

2010-07-28 Thread Lionel Barret
Hi Massimo, I spent the night on this and I think I got it. The problem, it is indeed the length but with a twist. In the table I showed you (see above), the length is specified as a string : length=128. But in the Field documentation, the length is an int. I suppose the length was eval'd

[web2py] Re: database cannot be modified anymore : migration between v1.44 current.

2010-07-28 Thread mdipierro
It was never evaled but I can see roblems with length being a string. ;-) On Jul 28, 3:49 am, Lionel Barret lionel.bar...@gmail.com wrote: Hi Massimo, I spent the night on this and I think I got it. The problem, it is indeed the length but with a twist. In the table I showed you (see above),

[web2py] Re: database cannot be modified anymore : migration between v1.44 current.

2010-07-27 Thread mdipierro
One of your fields has a length=None. Change it to a value or (better) set the type to 'text'. Massimo On Jul 27, 11:26 am, Lionel Barret lionel.bar...@gmail.com wrote: Hi all, We are moving our app from one host to the other. We used v1.44 on our old host, the new one use the current

[web2py] Re: database cannot be modified anymore : migration between v1.44 current.

2010-07-27 Thread mdipierro
P.S. you problem is 2 years old. You may also want to replace SQLField with Field and SQLDB with DAL for aesthetic reasons. On Jul 27, 11:31 am, mdipierro mdipie...@cs.depaul.edu wrote: One of your fields has a length=None. Change it to a value or (better) set the type to 'text'. Massimo On

[web2py] Re: database cannot be modified anymore : migration between v1.44 current.

2010-07-27 Thread Lionel Barret
Sorry to be slow but I don't get it. This is what I did : * changed the sqldb to dal * changed the sqlfield to field * check that the params were good (the text type you mention). tested on this table, defined in db.py : -- db.define_table('product_pages', Field('title',

[web2py] Re: database cannot be modified anymore : migration between v1.44 current.

2010-07-27 Thread mdipierro
Could you email me the app (confidentially)? On Jul 27, 12:07 pm, Lionel Barret lionel.bar...@gmail.com wrote: In fact, I can update a row but I cannot add a new one. On Jul 27, 7:01 pm, Lionel Barret lionel.bar...@gmail.com wrote: Sorry to be slow but I don't get it. This is what I did

[web2py] Re: database migration question

2010-06-23 Thread mdipierro
import_from_csv_file(... id_map={}..) If you import multiple tables and pass the same id_map (an empty dict) it will make sure references are not-broken for those tables. It will still breaks references between tables that are imported and tables that are not. On Jun 22, 4:23 pm, Peter Woolf

[web2py] Re: database locked SQLITE

2010-06-14 Thread mdipierro
please tell us more about the conditions that cause it. If you use the shell (or background process) at the same time as the web app make sure you unlock the db with periodic db.commit() Massimo On Jun 12, 9:42 pm, dbb asefa.deb...@gmail.com wrote: Help resolving this issue, the database keeps

[web2py] Re: Database Image Rendering

2010-06-03 Thread Yarko Tymciurak
Have you tried something like this: img='data:image/png;base64, {{=encodestring(my_db_stored_image)}}' / (replace png with whatever the correct image format it) Let us know if this works. - Yarko On Jun 3, 11:23 am, Aaron Crowe aaron.h.cr...@gmail.com wrote: How would I go about rendering an

[web2py] Re: Database Image Rendering

2010-06-03 Thread Yarko Tymciurak
On Jun 3, 11:52 am, Vasile Ermicioi elff...@gmail.com wrote: Yarkos approach will work only if you store it in a blob field, but not if image is uploaded in a directory my approach (Massimos approach :) ) should work for both cases What Vasile showed requires that the image file is in the

[web2py] Re: Database Image Rendering

2010-06-03 Thread mdipierro
Vasile approach (create an action to serve the blob as an image) is to be preferred because Yarko's approach is not cross-browser compatible. Anyway, if you choose to do it the Yarko's way be careful because you need to base64 encode not urlescape. web2py provides a helper to do this

[web2py] Re: Database Image Rendering

2010-06-03 Thread Yarko Tymciurak
On Jun 3, 12:07 pm, mdipierro mdipie...@cs.depaul.edu wrote: Vasile approach (create an action to serve the blob as an image) is to be preferred because Yarko's approach is not cross-browser compatible. Specifically IE 5-7 (see http://www.websiteoptimization.com/speed/tweak/inline-images/);

[web2py] Re: Database Image Rendering

2010-06-03 Thread Yarko Tymciurak
On Jun 3, 12:07 pm, mdipierro mdipie...@cs.depaul.edu wrote: Vasile approach (create an action to serve the blob as an image) is to be preferred because Yarko's approach is not cross-browser compatible. just to be clear: this approach does not by itself serve a blob - if there is no

[web2py] Re: Database migration does not work

2010-04-24 Thread Matthew
I'm including previously-defined tables in other tables to reduce maintenance. For example, I have __web_resource table that has Wikipedia IDs, etc that I'm using in other tables. When I tried your suggestion, I got the following error: File

[web2py] Re: Database migration does not work

2010-04-24 Thread mdipierro
you must have a very old web2py version. On Apr 24, 9:25 am, Matthew matthew.g.nor...@gmail.com wrote: I'm including previously-defined tables in other tables to reduce maintenance. For example, I have __web_resource table that has Wikipedia IDs, etc that I'm using in other tables. When I

[web2py] Re: Database migration does not work

2010-04-24 Thread Matthew
1.76.5 On Apr 24, 10:35 am, mdipierro mdipie...@cs.depaul.edu wrote: you must have a very old web2py version. On Apr 24, 9:25 am, Matthew matthew.g.nor...@gmail.com wrote: I'm including previously-defined tables in other tables to reduce maintenance. For example, I have __web_resource

[web2py] Re: Database migration does not work

2010-04-24 Thread mdipierro
hmmm. I guess I need to the model then. fake_migrate was supported in 1.76.5 Massimo On Apr 24, 9:37 am, Matthew matthew.g.nor...@gmail.com wrote: 1.76.5 On Apr 24, 10:35 am, mdipierro mdipie...@cs.depaul.edu wrote: you must have a very old web2py version. On Apr 24, 9:25 am, Matthew

[web2py] Re: Database migration does not work

2010-04-24 Thread Matthew
Here are the relevant parts of the model. I didn't copy the boilerplate code like connection string, etc at the start of the db.py file: # Common fields. ### # Web data. __web_resource = db.Table(db,

[web2py] Re: Database migration does not work

2010-04-24 Thread Matthew
Perfect! Thank you so much for your help. I had been including fake_migrate in the definition of the tables as well, which is what caused the second error. Thanks again! On Apr 24, 11:10 am, mdipierro mdipie...@cs.depaul.edu wrote: Try follow my instructions above and fake_migrate goes here:

[web2py] Re: Database migration does not work

2010-04-23 Thread Matthew
perf = db(db.performer.id 0).first() Traceback (most recent call last): File console, line 1, in module AttributeError: 'Set' object has no attribute 'first' perf = db(db.performer.id 0).select().first() Traceback (most recent call last): File console, line 1, in module File

[web2py] Re: Database migration does not work

2010-04-23 Thread mdipierro
Something went wrong with migration. Do this: 1) comment the field that gives you problem and set migrate to fake: db.define_table('performer', ... # Field('musicbrainz_guid'), ..., fake_migrate=True) # 2) run appadmin once (it should work) 3) uncomment field and remove

[web2py] Re: database is locked

2010-03-04 Thread vince
here's some more errorlog just fyi. actually it's easy to reproduce when opening page with lots of image needs to be download via web2py Traceback (most recent call last): File /home/web2py/gluon/main.py, line 488, in wsgibase session._try_store_in_db(request, response) File

Re: [web2py] Re: database is locked

2010-03-04 Thread Thadeus Burgess
The issue is that sqlite database is locked every time it is accessed. So if you have a-lot of concurrent requests, some of those will fail due to it being locked by other threads. The solution is to use a database that does not rely on locking such as postgresql or mysql. -Thadeus On Thu,

Re: [web2py] Re: database is locked

2010-03-04 Thread Jonathan Lundell
On Mar 4, 2010, at 1:08 PM, Thadeus Burgess wrote: The issue is that sqlite database is locked every time it is accessed. So if you have a-lot of concurrent requests, some of those will fail due to it being locked by other threads. The solution is to use a database that does not rely on

Re: [web2py] Re: database is locked

2010-03-04 Thread Thadeus Burgess
Vince has had this problem in the past, and it was due to the .table files being locked, he solved it by setting migrate=False. Has he forgotten about this? I just did a quick search on the groups for lots of images -Thadeus On Thu, Mar 4, 2010 at 3:23 PM, Jonathan Lundell

[web2py] Re: database is locked

2010-03-04 Thread vince
when migrate=False it fixed the .table locking problem. but this database locking issue is just another one, actually it's just a single user application and i still have this problem. i think it should be delay instead of return error when the file is locked. same case apply to .table files

<    1   2   3