Hi Anthony,
Problem of drop down's not working can be seen with the code/data posted in
the original slice can be seen with the following changes.
*Controller :*
def index():
grid = {}
if request.vars.maker_name:
query = (db.Product.Maker_ID==request.vars.maker_name)
HI Anthony,
Changes suggested by you in the controller to reduce the complexity of the
function actually worked, now the drop down options are changed instantly.
However, I am observing one strange problem now. Somehow the getResults()
function is not called when the drop down options are
Not sure I follow. Please show the code.
Also, I'm surprised that code change made such a difference. My code did
limit the select to just the necessary fields. Does that table include
other fields that contain large amounts of data (e.g., a blob field)?
Anthony
On Friday, May 23, 2014
Would help to see some code. 4-5 seconds sounds much too long.
You might also look into http://dev.s-cubism.com/plugin_lazy_options_widget.
Anthony
On Thursday, May 22, 2014 12:17:42 AM UTC-4, Sarbjit wrote:
Hi,
I am using cascading drop-down based on the slice posted on
Hi Anthony,
Code is almost identical to the code posted in slice with change in field
names and number of records. Only additonal difference is that I am using
orderby in the query before returing the results.
Surprisingly, sometime the result appears fast (within 2-3 seconds) but
some time
Hi Anthony,
Code is almost identical to the code posted in slice with change in field
names and number of records. Only additonal difference is that I am using
orderby in the query before returing the results.
Surprisingly, sometime the result appears fast (within 2-3 seconds) but
some time
Do you have index on your table?
Richard
On Thu, May 22, 2014 at 8:39 AM, Sarbjit sarbjit1...@gmail.com wrote:
Hi Anthony,
Code is almost identical to the code posted in slice with change in field
names and number of records. Only additonal difference is that I am using
orderby in the
Would still help to see your specific model code. Is the field in question
a reference field with a represent attribute? If so, you'll get separate
queries for each item in order to lookup the represent value. How many
records in the table? Do you have an index on the field being searched? If
Below is the snippets from code (I have changed few field names as I can't
share the exact field names)
-- Data base
db.define_table('Table1',
Field('Release'),
format='%(Release)s')
db.define_table('Table2',
First, you can simplify your function as follows:
def getResults():
tab2results = db(db.Table2.Release == request.vars.release_name).select(
db.Table2.id, db.Table2.Year, orderby=~db.Table2.id)
return SELECT([OPTION(r.Year, _value=r.id) for r in tab2results],
perhaps you can follow the books advise on :
Thanks Anthony,
I will try and will update.
I am new to web2py (web apps in general). Could you please provide me an
example on how to create index on table and once created, what changes i
have to do in controller, do i need to change the getResults function?
-Sarbjit
On Thursday, May 22,
In addition to this, and assuming that the data doesn't change
frequently (days vs minutes), maybe a select-cache, with TTL of 24 hours
would help?
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Caching-selects
Kiran
Sarbjit,
The index creation is something that you would do on the database.
Web2py doesn't have a role to play there.
For postgres: http://www.postgresql.org/docs/9.3/static/sql-createindex.html
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
Yes, In-fact the data is expected to change once in week.
Regarding Index on table, I know DAL doesn't provides a direct way of doing
it, my question is once i have created an index on my table, do i need to
modify anything in my controller?
-Sarbjit
On Thursday, May 22, 2014 7:54:54 PM
On Thursday, May 22, 2014 10:31:51 AM UTC-4, Sarbjit wrote:
Yes, In-fact the data is expected to change once in week.
Regarding Index on table, I know DAL doesn't provides a direct way of
doing it, my question is once i have created an index on my table, do i
need to modify anything in
your print statement is probably making this a lot slower than it needs to
be. console output is slow.
Also, you may want to take a look at my cascading dropdowns since I do it
in a more web2py way. It may also be easier to understand. You shouldn't
create the html 'by hand' like you are doing
17 matches
Mail list logo