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
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,
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
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
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
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
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.
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
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
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
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
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
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
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
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.
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
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
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
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
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.
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
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
We might more detail about what you are trying to do including some code
samples.
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
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
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
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,
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
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
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
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
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
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
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
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
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
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 = ...
Any ideas?
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.
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
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
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
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
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
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
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
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:
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
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
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
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.
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 ==
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),
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
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
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)
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
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),
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
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
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',
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
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
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
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
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
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
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/);
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
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
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
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
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
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,
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:
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
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
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
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,
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
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
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
201 - 282 of 282 matches
Mail list logo