Re: [web2py] Performance issues while opening webpage with more than 1 lakh records.....

2013-02-21 Thread neha srivastava
Thanks for your prompt response. I am using sqlite database.I placed {{=response.toolbar()}} in view and found that, query which is being used in SQLFORM.grid is taking more time than others. Please find below the query and time taken to execute: SELECT table1.device, table1.user, table1.type, t

[web2py] strange things in db populate

2013-02-21 Thread 黄祥
hi, i found strange things in db populate: e.g. *#will generate strings more than 32 characters using populate* *models/db.py* db.define_table('brand', Field('*brand*'), format='%(*brand*)s') db.brand.brand.requires=[IS_LENGTH(32), IS_NOT_IN_DB(db, 'brand.*brand*')] *models/db_populate

Re: [web2py] Re: Smartgrid: How to display value from foreign table in a table when only foreign key is in table

2013-02-21 Thread Alex Glaros
It worked Jim thanks so much for going through the process of writing and testing the code. I'm new to web2py, is there any preference as to where that statement goes: controller or model? much appreciated, Alex On Thu, Feb 21, 2013 at 8:31 PM, Jim S wrote: > Add this line before creating yo

Re: [web2py] Performance issues while opening webpage with more than 1 lakh records.....

2013-02-21 Thread Bruno Rocha
what is your database engine? we need to see if the bottleneck is in database side. Place a {{=response.toolbar()}} in your view and paste here the generated SQL and timings. Are you using pagination? how many per page? even with 100.000 records, the grid should use an offset to limit the loaded

[web2py] Performance issues while opening webpage with more than 1 lakh records.....

2013-02-21 Thread newbie
Hi , i am a newbie in Web2pyI have more than 1 lakh records in database table1 and i am displaying that table through an SQLFORM.grid.The problem is the corresponding WebPage for this table1 is taking more than 15 seconds to open.Is there a way we can solve this performance issue??.

[web2py] block sidebar define in views to replace layout.html

2013-02-21 Thread 黄祥
hi, i'm following the book guide about creating block sidebar http://web2py.com/books/default/chapter/29/05#Default-page-layout, and it's not work (no error occured). so i'm just following the scaffolding application, and it's work : e.g. *views/default/index.html : work modified from scaffold

[web2py] Re: Smartgrid: How to display value from foreign table in a table when only foreign key is in table

2013-02-21 Thread Jim S
Add this line before creating your smartgrid: db.Word.dictionaryTypeID.represent = lambda s,r: s.dictionaryName Does that help? It worked for the trimmed down model I made... -Jim On Thursday, February 21, 2013 9:16:39 PM UTC-6, Alex Glaros wrote: > > db.define_table('HumanLanguage',Field('la

[web2py] Re: what is the name of an uploaded file using sqlform.factory?

2013-02-21 Thread Tim Richardson
On Friday, 22 February 2013 14:23:23 UTC+11, Massimo Di Pierro wrote: > > Can you explain it again? > > On Thursday, 21 February 2013 06:52:33 UTC-6, Tim Richardson wrote: >> >> Actually, >> the file name works fine when using the name of the field at least in a >> string context. >> >> >> In s

[web2py] Re: routing problem using two routes.py

2013-02-21 Thread Massimo Di Pierro
Please do not use 2.0.x it was known to be buggy. Use 2.3.2 or nightly 2.4.0. On Thursday, 21 February 2013 16:55:19 UTC-6, greaneym wrote: > > > Hello, > > using web2py v2.0.8 on a linux server. > > My server hosting my website has a name like xxx-yyy.abc.com. > An alias is set up on my domain s

[web2py] Re: what is the name of an uploaded file using sqlform.factory?

2013-02-21 Thread Massimo Di Pierro
Can you explain it again? On Thursday, 21 February 2013 06:52:33 UTC-6, Tim Richardson wrote: > > Actually, > the file name works fine when using the name of the field at least in a > string context. > > > -- --- You received this message because you are subscribed to the Google Groups "web

[web2py] Re: Error db._adapter

2013-02-21 Thread Massimo Di Pierro
Does it work if you replace db(db.auth_user).isempty(): with len(db(db.auth_user).select(limitby=(0,1))) * * *This is not a solution but can help me understand. * On Thursday, 21 February 2013 14:07:25 UTC-6, __pyslan__ wrote: > > Sorry... > > The error occur on line 3 of this file: > > https:/

[web2py] Re: Smartgrid: How to display value from foreign table in a table when only foreign key is in table

2013-02-21 Thread Alex Glaros
db.define_table('HumanLanguage',Field('languageName','string'),Field('forumLocations','string'),Field('comments','string'), auth.signature) db.HumanLanguage.languageName.requires = IS_NOT_EMPTY() db.define_table('Word',Field('wordName','string'), Field ('definition', 'string'), Field('languageI

[web2py] Re: Smartgrid: How to display value from foreign table in a table when only foreign key is in table

2013-02-21 Thread Jim S
Can you show the model code? -Jim On Thursday, February 21, 2013 7:35:52 PM UTC-6, Alex Glaros wrote: > > Instead of *db.Word.dictionaryTypeID* displaying (which is a foreign key > in db.Word), I’d like a value from the foreign table to appear, i.e., > DictionaryType. dictionaryName. > > > In t

[web2py] Re: web2py under GAE: disabling indexes

2013-02-21 Thread Scott Hunter
According to https://developers.google.com/appengine/docs/python/datastore/indexes#Unindexed_Properties, "You declare a property unindexed by setting indexed=False in the property constructor". One incurs the cost of a write (or 2?) for every property of a record that gets written; so, for a

[web2py] Smartgrid: How to make value from foreign table appear in table when only foreign key is in table

2013-02-21 Thread Alex Glaros
Instead of *db.Word.dictionaryTypeID* displaying (which is a foreign key in db.Word), I’d like a value from the foreign table to appear, i.e., DictionaryType. dictionaryName. In the example below, when user cascades down to the Word table, it only shows db.Word.dictionaryTypeID but I’d like

[web2py] FORM question- Retrieving value in a field onchange

2013-02-21 Thread Jack
Hi All, I was wondering if this is an possibility. Assume I have a form that includes two fields that take text input. Is there a way to implement a mechanism where after I've typed whatever I want in the first field, and the same string will appear in the second field or, have the text appende

[web2py] Re: smartgrid fails to show consistent behavior between parent and child tables

2013-02-21 Thread Jim S
Try moving your db.person.url.represent = lambda url, row: A(url,_href=url) into your list_organizations method. I don't believe your list_people method isn't utilized in the screen shots provided. -Jim On Thursday, February 21, 2013 5:23:27 PM UTC-6, wwwgong wrote: > > using web2py v2.3.2,

[web2py] Re: Keyed tables and str references?

2013-02-21 Thread Alec Taylor
Whoops, I'm actually using SQLite (for dev) and Postgres [with PostGIS] (for prod). :\ Guess the requires=IS_IN_DB is the only syntax remaining for me to enforce referential integrity… On Friday, February 22, 2013 5:57:24 AM UTC+11, DenesL wrote: > > Hi Alec, > > is your db one of the supporte

[web2py] routing problem using two routes.py

2013-02-21 Thread greaneym
Hello, using web2py v2.0.8 on a linux server. My server hosting my website has a name like xxx-yyy.abc.com. An alias is set up on my domain server's host so that my site is www.xxx.com. The routes.py configuration I have is working, but I want to make a change in order to use the server's ssl

Re: [web2py] Re: command line question

2013-02-21 Thread Bruno Rocha
after you untar it do a: chown -R user:group web2py/applications -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For

[web2py] Re: Need for '/index/args' following controller to grab 'args'?

2013-02-21 Thread howesc
i use the regex router, and have this in one of my projects: ('/promo/(?P.*)', '/appname/promo_page/signup/$f'), # promo codes to the promo_page controller so this takes a url like /promo/freestuff and sends to /appname/pomo_page/signup/freestuff i think essentially doing as you a

[web2py] Re: command line question

2013-02-21 Thread Hector Magnanao
when I do the untar myself, and bring up the application, it doesn't work because the file ownerships are all wrong. This happens in the linux server. I was just wondering if there was a way to install it using web2py to install the application through command line. On Thursday, February 2

[web2py] Re: web2py under GAE: disabling indexes

2013-02-21 Thread howesc
i'm being lazy heredo you have the instructions (or link to instructions) from GAE for disabling indexes? i don't have it handy right now we can check if the DAL has a secret way to handle it, and/or create a patch to allow it. may i ask what advantage you are hoping to achieve by ski

Re: [web2py] Re: Error db._adapter

2013-02-21 Thread __pyslan__ - Ayslan Jenken
Hi, Niphlod. The rollback will be placed, no doubt. I had tests done without using db._adapter.parse and the error is the same. On Thu, Feb 21, 2013 at 5:21 PM, Niphlod wrote: > trying to give out some hints. seems that the first query you run after > calling the sp doesn't find a resultset.

[web2py] Re: Error db._adapter

2013-02-21 Thread Niphlod
trying to give out some hints. seems that the first query you run after calling the sp doesn't find a resultset. possible problems: - whenever raising an exception on db.executesql, always call db.rollback() to flush out the cursor - instead of using db._adapter.parse, just pass fields and colnam

Re: [web2py] How to construct an URL with non ASCII chars, (and about idna)

2013-02-21 Thread Jonathan Lundell
On 21 Feb 2013, at 12:08 PM, puercoespin wrote: > I have a table with a field with non-ASCII names. And i want to use those to > construct the url. > > So, ie, a Spanish locality as "Aigües Tortes d'alt Ampurdà", I want to send > the url: "http://mydomain/init/controller/function/ Ampurdà>'.

[web2py] How to construct an URL with non ASCII chars, (and about idna)

2013-02-21 Thread puercoespin
I have a table with a field with non-ASCII names. And i want to use those to construct the url. So, ie, a Spanish locality as "Aigües Tortes d'alt Ampurdà", I want to send the url: "http://mydomain/init/controller/function/'. In the view, in request.args(0), I want to recover the original n

[web2py] Re: Error db._adapter

2013-02-21 Thread __pyslan__ - Ayslan Jenken
Sorry... The error occur on line 3 of this file: https://gist.github.com/pyslan/5007722 On Thu, Feb 21, 2013 at 4:45 PM, __pyslan__ - Ayslan Jenken < ayslan.pyt...@gmail.com> wrote: > Hello, Erevybody! > > I am using MySQL on a project and created two procedures to perform a > recursion, becau

[web2py] Error db._adapter

2013-02-21 Thread __pyslan__ - Ayslan Jenken
Hello, Erevybody! I am using MySQL on a project and created two procedures to perform a recursion, because users have users parents. The extra fields in the users table: https://gist.github.com/pyslan/5007384 Performing some research and testing, I came to the code as follows: https://gist.gith

[web2py] Re: In search of CAS 2 provider and consumer example

2013-02-21 Thread Massimo Di Pierro
Not sure what example to write. Make two copies of the welcome app. Call one app1 and one app2. Create and account and login in app1. Edit app2/models/db.py and replace auth = Auth(db) with auth = Auth(db,cas_provider = 'http://127.0.0.1:8000/app1/default/user/cas') Now try login in app2.

[web2py] Re: Keyed tables and str references?

2013-02-21 Thread DenesL
Hi Alec, is your db one of the supported ones for keyed tables? (DB2, MS-SQL, Ingres or Informix) -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py

[web2py] Re: callback target in two places

2013-02-21 Thread 黄祥
thank you so much for your detail explaination anthony. i've spent more time following your advice to learn about javascript/jquery and python through update my code but still not work (no error occured, but what i'm expected is not realize). the basic logic is when user click the button it will

[web2py] Re: command line question

2013-02-21 Thread Niphlod
just unpack it under applications/ cd applications/whatever tar xzvf thetarfile.tar or see into gluon.fileutils using w2p_unpack() or directly untar(). By if you have a cmdline tar available, just use that one. On Thursday, February 21, 2013 5:52:33 PM UTC+1, Hector Magnanao wrote: > > Is ther

[web2py] command line question

2013-02-21 Thread Hector Magnanao
Is there a command line option in web2py to install an application ? I'm trying to install a tar file through command line. Maybe there is a python command that I need to run. Any suggestions would be welcomed. -- --- You received this message because you are subscribed to the Google Groups

Re: [web2py] SQLFORM.grid custom search where is the error?

2013-02-21 Thread Mandar Vaze
I'm using Version "2.3.2 (2012-12-17 15:03:30) stable" and the problem still persists. i.e. I'm still getting "Invalid Query" error. I'm using Alex's workaround which seems to be working. Thanks Alex. -Mandar On Friday, September 28, 2012 6:07:13 PM UTC+5:30, Massimo Di Pierro wrote: > > Clearl

[web2py] Re: In search of CAS 2 provider and consumer example

2013-02-21 Thread Massimo Di Pierro
CAS 2 is built in in web2py. Every web2py app is always a CAS 2 provider (nothing to do about it). Every app can also be a CAS 1/2 consumer but must be enabled. http://web2py.com/books/default/chapter/29/09?search=CAS#Central-Authentication-Service On Wednesday, 20 February 2013 14:01:26 UTC-6

[web2py] Re: VirtualFields on select options

2013-02-21 Thread Massimo Di Pierro
Thank you! In trunk. Please check it. On Wednesday, 20 February 2013 13:29:05 UTC-6, Felipe Meirelles wrote: > > I was using a outdated version of web2py, in the new version the line is > 511 > > On Wednesday, February 20, 2013 12:42:05 PM UTC-3, Felipe Meirelles wrote: >> >> Hi, >> >> Just found

Re: [web2py] Re: update Databases

2013-02-21 Thread Jim S
The answer is here in the book: http://web2py.com/books/default/chapter/29/07#FORM To summarize, use the: if form.accepts(request,session): # read further down in the book for shortcuts and a better understanding ...to validate the form. If it passes validation, then use the DAL insert

Re: [web2py] Re: update Databases

2013-02-21 Thread Waqas Iqbal
form=FORM(SPAN('Default Group', _class='label'), SELECT(group_names, _name='group', _id='hospitalDropdown', _class="select"), INPUT(_type='submit',_name="fancyGroupUpdate", _value="Submit")) that's how i created my form. lots of thanks. Best Regards, Waqas Iqbal

[web2py] Re: update Databases

2013-02-21 Thread Jim S
Also, have you read this chapter of the book? http://web2py.com/books/default/chapter/29/07 Lots of good info there. -Jim On Thursday, February 21, 2013 5:22:23 AM UTC-6, waqasiqb...@gmail.com wrote: > > how should i update my database on pressing submit button?? > > -- --- You received t

[web2py] Re: update Databases

2013-02-21 Thread Jim S
That depends on how you built your form. Can you show some code? -Jim On Thursday, February 21, 2013 5:22:23 AM UTC-6, waqasiqb...@gmail.com wrote: > > how should i update my database on pressing submit button?? > > -- --- You received this message because you are subscribed to the Google

[web2py] sanction in web2py 2.4.x

2013-02-21 Thread samuel bonilla
Dr. massimo, can you add 'santion(https://github.com/demianbrecht/sanction)' in web2py 2.4.x, for multiple authentication without third as Janrain -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop re

[web2py] web2py under GAE: disabling indexes

2013-02-21 Thread Scott Hunter
As I understand it, the GAE datastore will automatically create an index for every field of every table (to facilitate queries using single fields); those requiring multiple fields also get generated, but will get added to index.yaml by the SDK when tested locally. Since these are created outsi

[web2py] Re: Fixing Failed Migrations

2013-02-21 Thread Philip Kilner
Hi Niphlod, Thanks for the quick reply. On 21/02/13 13:18, Niphlod wrote: I'll explain the normal behaviour, don't know if it applies to google cloud sql. I think its behaviour is that of MySQL. web2py receives a request. that request execute models. in models you have the db definition.

[web2py] Re: Fixing Failed Migrations

2013-02-21 Thread Niphlod
I'll explain the normal behaviour, don't know if it applies to google cloud sql. web2py receives a request. that request execute models. in models you have the db definition. If migrations are turned on (migrate=True), web2py compares the current define_table statements with the .table files s

[web2py] Re: what is the name of an uploaded file using sqlform.factory?

2013-02-21 Thread Tim Richardson
Actually, the file name works fine when using the name of the field at least in a string context. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py

[web2py] Re: import track_changes when using sys.path.append to import module in custom location

2013-02-21 Thread Tim Richardson
On Monday, 11 February 2013 03:20:47 UTC+11, Massimo Di Pierro wrote: > > No. Track changes only tracks changes for modules that are stored in the > application. > While looking for something else, I came across this in the online version of the book, in the core chapter; I've emphasised in bo

[web2py] Fixing Failed Migrations

2013-02-21 Thread Philip Kilner
Hi All, I have a failed migration (on Google Cloud SQL, so MySQL, near enough). Looking at the web2py boo, it suggests using: - db.define_table(,migrate=False,fake_migrate=True) ...to find the problem table - done. I then says "This will rebuild web2py metadata about the table according

[web2py] Re: Session Issue/Question

2013-02-21 Thread Niphlod
expiration and log_expiration is what you're looking for. http://web2py.com/books/default/chapter/29/09?search=expiration On Thursday, February 21, 2013 12:18:30 PM UTC+1, Auden RovelleQuartz wrote: > > I have long noticed that intermittently and on "first use" events (first > time using a comput

[web2py] update Databases

2013-02-21 Thread waqasiqbal . knysys
how should i update my database on pressing submit button?? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more o

Re: [web2py] Re: Submit button in next line

2013-02-21 Thread Waqas Iqbal
form=SPAN(SPAN('Default Group', _class='label'), SELECT(group_names, _name='group', _id='hospitalDropdown', _class="select"), SPAN(INPUT(_type='submit', _value="Submit"))) do i have to create span like this?? Best Regards, Waqas Iqbal | Associate Software Engineer [i

[web2py] Session Issue/Question

2013-02-21 Thread Auden RovelleQuartz
I have long noticed that intermittently and on "first use" events (first time using a computer after a few hours), that when I log onto my Web2py application, it seems that soon after logging in, the system will forget all session data and in essence, log the user out. After the user logs in a

Re: [web2py] Re: Submit button in next line

2013-02-21 Thread Waqas Iqbal
thanks Niphold ..it works!! cheers Best Regards, Waqas Iqbal | Associate Software Engineer [image: Inline image 1] W +92-21-34972358 | M +92-342-3146972 Gtalk: waqasiqbal.knysys| wiq...@knysys.com ** www.knysys.com | www.knyapps.com On Thu, Feb 21, 2013 at 2:58 AM,

[web2py] Re: Submit button in next line

2013-02-21 Thread Niphlod
your outer container is a span, and by default span are inline-blocks. Use a separate SPAN for the submit. On Thursday, February 21, 2013 11:50:12 AM UTC+1, waqasiqb...@gmail.com wrote: > > how i put my submit button in next line , my submit button is in form and > that form is in my controlle

[web2py] Submit button in next line

2013-02-21 Thread waqasiqbal . knysys
how i put my submit button in next line , my submit button is in form and that form is in my controller's function form=SPAN(SPAN('Default Group', _class='label'), SELECT(group_names, _name='group', _id='hospitalDropdown', _class="select"), INPUT(_type='submit', _value

[web2py] Re: [Newbee] - Error message with plugin_Wiki : 'auth' not defined

2013-02-21 Thread openoc80
I think I did a mistake ... it is a plugin then I must create one application and for this application to install this plugin. It is logic. Am I right ? I am going to look after an video or some informations on the Web2Py 's book . If I am not right if somebody can gives me some information...

[web2py] Re: [Newbee] - Error message with plugin_Wiki : 'auth' not defined

2013-02-21 Thread openoc80
I think that i am quite stupid : it is a plugin ! I must create one application and after to install this plugin. I must read more the Web2Py 's book or one video or tuto on this. Regards, Bruno On Wednesday, February 20, 2013 3:17:42 PM UTC+1, open...@gmail.com wrote: > > Hi all, > > I am beg

[web2py] Re: [Newbee] - Error message with plugin_Wiki : 'auth' not defined

2013-02-21 Thread openoc80
It is a plugin I must create one application and after install this plugin for this application. I must read better the Web2Py 's manual !! I am quite stupid ! *S*orry, Bruno On Wednesday, February 20, 2013 3:17:42 PM UTC+1, open...@gmail.com wrote: > > Hi all, > > I am beginner in Web

Re: [web2py] Re: Customising SQLFORM.grid

2013-02-21 Thread Philip Kilner
Hi Niphlod, On 21/02/13 09:47, Niphlod wrote: - I'd like to move the pagination control to the top. Use css rules, or js. Let it be flexible, grid's markup is still experimental (i.e. could change in future versions) OK - is there a decent example of this anywhere? Will roll my sleeves u

[web2py] Re: Customising SQLFORM.grid

2013-02-21 Thread Niphlod
On Thursday, February 21, 2013 10:32:30 AM UTC+1, Philip Kilner wrote: > > Hi, > > I'm making a lot of use of SQLFORM.grid, which is a great tool, and has > saved me an enormous amount of time. > > Now that I have my application running, I'd like to customise some > aspects of it, and wondere

[web2py] Customising SQLFORM.grid

2013-02-21 Thread Philip Kilner
Hi, I'm making a lot of use of SQLFORM.grid, which is a great tool, and has saved me an enormous amount of time. Now that I have my application running, I'd like to customise some aspects of it, and wondered if there was a "howto" somewhere, or if anyone has any suggestions about the best way

Re: [web2py] Re: Error mysql

2013-02-21 Thread Niphlod
no, no, no and still no. Please don't introduce more doubts than the ones already there about table migrations. If the error is "table x already exists" it means that migrations are turned ON, otherwise web2py wouldn't attempt to create them. The problem here is that db is not empty, while the