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

2013-02-22 Thread Niphlod
32 ms means 0.0032 seconds. Database is not the issue. PS: I may be old enough to miss some new-style definitions, but what is precisely " 1 lakh records" ? On Friday, February 22, 2013 8:16:43 AM UTC+1, newbie wrote: > > Thanks for your prompt response. > I am using sqlite database.I placed {{=r

[web2py] Re: strange things in db populate

2013-02-22 Thread Niphlod
Always use length to indicate the field 'string' length. requires= is just for forms. Field('brand', length=32) On Friday, February 22, 2013 7:27:40 AM UTC+1, 黄祥 wrote: > > hi, > > i found strange things in db populate: > > e.g. > *#will generate strings more than 32 characters using populate*

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

2013-02-22 Thread Philip Kilner
Hi Niphlod, On 22/02/13 08:33, Niphlod wrote: PS: I may be old enough to miss some new-style definitions, but what is precisely " 1 lakh records" ? 100k - see http://en.wikipedia.org/wiki/Lakh -- Regards, PhilK 'a bell is a cup...until it is struck' -- --- You received this message b

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

2013-02-22 Thread Niphlod
wonderful. thanks. @newbie: can you see how many seconds it takes the query that has a count() in it ? that one is probably taking more than a few millisec. PS: SQlite starts to be kinda not the preferred way to store 10^5 records. -- --- You received this message because you are subscribed

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

2013-02-22 Thread neha srivastava
I mentioned wrong data for the query which SQLFORM.grid is executed so sorry for that, basically that query is taking 0.00 ms and below query has taken 32.00 ms: SELECT count(*) FROM table1 WHERE (table1.id > 0); On Fri, Feb 22, 2013 at 2:24 PM, Niphlod wrote: > wonderful. thanks. > @newbie:

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

2013-02-22 Thread Niphlod
if SQLite takes 32 ms to count 10^5 records, than I'm impressed (or, more likely, astonished) with its performance (but I remain dubious that you're reading the correct timings). Seems that the database is not the issue. Can we see the model for that table ? On Friday, February 22, 2013 10:07:3

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

2013-02-22 Thread neha srivastava
I cross-verified and got the same result , timings is 32.00 ms for count query.Anyways, please find below the model and controller code: Model: db.define_table('table1', Field('device', type="reference devices", ondelete="SET NULL"), Field('type', 'integer'), Field('message', 'string', r

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

2013-02-22 Thread Niphlod
ok. how many "devices" and "users" are there ? maybe the time is spent formatting references back to their "nice" format. PS: can you post here the complete list of timings as returned by response.toolbar() ? On Friday, February 22, 2013 11:15:11 AM UTC+1, newbie wrote: > > I cross-verified and

[web2py] Re: strange things in db populate

2013-02-22 Thread 黄祥
a, thank you so much for your hints niphlod. but the strange part is not answered, because the field name affect the result. -- --- 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,

[web2py] Re: strange things in db populate

2013-02-22 Thread Niphlod
that's how populate works. if it finds "name" in the field, it uses a different pattern to fill it. same thing happens for field containing "url" and "email" It's a non-issue since the generated data is meant to be totally bogus. PS: web2py's source code is open-source. You have it on your disk

[web2py] smartgrid selectable comments

2013-02-22 Thread Kostas M
I have implemented an SQLFORM.smartgrid with a selectable lambda function for handling the rows the user has selected. The proper action for the selected rows, is again selected by the user through an 'actions' pulldown menu on the first column of the table's header. What I would like next, is a

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

2013-02-22 Thread Javier Pepe
Alex Use represent for this: http://web2py.com/books/default/chapter/29/06#Record-representation Ej: db.Word.dictionaryTipeID.represent = lambda id,row: db.DictionaryType (id).dictionaryName On Thu, Feb 21, 2013 at 10:35 PM, Alex Glaros wrote: > Instead of *db.Word.dictionaryTypeID* displ

Re: [web2py] Re: Error db._adapter

2013-02-22 Thread __pyslan__ - Ayslan Jenken
Hello, Massimo. With this change is launched this error: Traceback (most recent call last): File "/ home/ctx/PROJECTS/WEB/web2py/gluon/main.py", line 632, in wsgibase BaseAdapter.close_all_instances ('rollback') File "/ home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 543, in close_all

Re: [web2py] Re: Error db._adapter

2013-02-22 Thread __pyslan__ - Ayslan Jenken
Well... Sorry, but the information about the code comment is wrong... I uncomment the code block "if db(db.auth_user).isempty():" and the error not thrown. With or without the code block above, in the terminal server is shown the error: DEBUG: connect attempt 0, connection error: Traceback (mos

[web2py] Re: smartgrid selectable comments

2013-02-22 Thread Niphlod
code your own form serialization and handle it outside the grid, or put your textarea within the automatically generated form by the grid. Either way with javascript: the normal functionality of selectable doesn't provide anything else than the record selection itself, but it's not difficult at

[web2py] Validate some condition to insert using SQLForm.grid()

2013-02-22 Thread Christian Espinoza
Hi guys, there a way to validate some condition before run the insert of a new record using SQLForm.grid() ? For example if I need insert a record, but a rule ( a value at the db, a constant) said that the records must be only < 5 and I have already 4 records, then the insert can't be run... Th

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

2013-02-22 Thread Jim Steil
Depends on whether or not you want that behavior globally or not. Remember, your model gets executed on every request. So, if you want that behavior globally I'd put it there. If you just need it for one instance, put it in the controller. -Jim On Fri, Feb 22, 2013 at 12:20 AM, Alex Glaros w

[web2py] Re: Validate some condition to insert using SQLForm.grid()

2013-02-22 Thread Niphlod
use onvalidation just like any other SQLFORM On Friday, February 22, 2013 2:22:06 PM UTC+1, Christian Espinoza wrote: > > Hi guys, there a way to validate some condition before run the insert of a > new record using SQLForm.grid() ? > > For example if I need insert a record, but a rule ( a value

[web2py] Re: Validate some condition to insert using SQLForm.grid()

2013-02-22 Thread Jim S
You have a couple different options. 1. Custom validators (not as scary as they sound) - http://web2py.com/books/default/chapter/29/07#Custom-validators 2. Before and after callbacks - http://web2py.com/books/default/chapter/29/06#before-and-after-callbacks That should get the job done. -Jim

[web2py] Re: Validate some condition to insert using SQLForm.grid()

2013-02-22 Thread Christian Espinoza
Thanks guys, I'll try with it.. El viernes, 22 de febrero de 2013 10:28:27 UTC-3, Jim S escribió: > > You have a couple different options. > > 1. Custom validators (not as scary as they sound) - > http://web2py.com/books/default/chapter/29/07#Custom-validators > 2. Before and after callbacks -

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

2013-02-22 Thread Massimo Di Pierro
Can we also see what event_pretty does? On Friday, 22 February 2013 04:15:11 UTC-6, newbie wrote: > > I cross-verified and got the same result , timings is 32.00 ms for count > query.Anyways, please find below the model and controller code: > > Model: > > db.define_table('table1', >Field('dev

[web2py] problem in database updating

2013-02-22 Thread waqasiqbal . knysys
i am having trouble while updating database on selection of the option from dropdown menu , after selecting an option it's not updating my database, i ma printing an error and its output is like * form.vars: can u explain what should i do to fix it.?? * -- --- You received this message beca

[web2py] custom validation for Authentication form

2013-02-22 Thread frasse
Hi I have done some custom login form like this in db.py file. auth = Auth(db, hmac_key=Auth.get_or_create_key()) crud, service, plugins = Crud(db), Service(), PluginManager() auth.settings.extra_fields['auth_user']= [ Field('WithdrawalAddress', label = 'Withdrawal Address'), Field('Address',

[web2py] Re: strange things in db populate

2013-02-22 Thread 黄祥
a, i c, thank you so much for your info, niphlod, because i'm still learning in web2py -- --- 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...@

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

2013-02-22 Thread wwwgong
Jim Thanks, Your suggestion worked. It would be nice if one does not have to duplicate the code, any idea how parent can inherit child's behavior? W On Thursday, February 21, 2013 6:32:58 PM UTC-5, Jim S wrote: > > Try moving your > > db.person.url.represent = lambda url, row: A(url,_href=url)

[web2py] Re: problem in database updating

2013-02-22 Thread Niphlod
these threads requesting support without any code are beginning to pollute too much this list. We're an active community and a lot of users helped you right away, but you can't continue to ask for solutions without providing a reproduceable example. On Friday, February 22, 2013 3:38:59 PM UTC+

[web2py] Re: custom validation for Authentication form

2013-02-22 Thread Niphlod
using requires directly in those appended fields doesn't work ? On Friday, February 22, 2013 3:41:04 PM UTC+1, frasse wrote: > > Hi > I have done some custom login form like this in db.py file. > > auth = Auth(db, hmac_key=Auth.get_or_create_key()) > crud, service, plugins = Crud(db), Service(),

[web2py] database validation on models or controllers side

2013-02-22 Thread 黄祥
hi, i found similarities in some of database validator and field constructor, should i use all of the similar function or not? which is better in controllers side or in models side? for example for similarities required=True similar with notnull=True and requires=IS_NOT_EMPTY() length=10 simil

[web2py] NicEdit + image upload on a textarea

2013-02-22 Thread Loïc
Dear all, I had some trouble to use the "upload" button in NicEdit WYSIWYG editor. Now it works, so I share an example with wou, hoping it can help somebody. This code is probably not optimized, so feel free to adapt it This code uploads images in static/images/pages_content/[Name of the page]/

[web2py] Re: database validation on models or controllers side

2013-02-22 Thread Niphlod
http://web2py.com/books/default/chapter/29/06 *Notice that requires=... is enforced at the level of forms, required=Trueis enforced at the level of the DAL (insert), while notnull, unique and ondelete are enforced at the level of the database. While they sometimes may seem redundant, it is impo

Re: [web2py] Re: custom validation for Authentication form

2013-02-22 Thread farzad faramarzi
I think it works if the requires is exist like writable = , readable= .. but I want to validate the format of the text in the field. which requires should I use than ? can I do writable=False, readable=False, myformat = validFormat() ? /F 2013/2/22 Niphlod > using requires directly in those ap

Re: [web2py] Re: custom validation for Authentication form

2013-02-22 Thread Niphlod
you'll do it the same way as a field in an external table. If you have prepared your own custom validator, pass that in the requires= argument If instead you have no notion on how to force a particular validator that is not provided by web2py, read http://web2py.com/books/default/chapter/29/07#

[web2py] Tip

2013-02-22 Thread __pyslan__ - Ayslan Jenken
Hello everybody! Well, I still have not solved the problem with stored procedures in MySQL, but I need to continue the project and I solved another issue, the user login to the same database by another application. I will leave my tip here and ask for more experienced developers evaluate and give

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

2013-02-22 Thread Jim Steil
Then you could put the code in your model. Would be global then On Feb 22, 2013 9:04 AM, "wwwgong" wrote: > Jim > Thanks, Your suggestion worked. > It would be nice if one does not have to duplicate the code, any idea how > parent can inherit child's behavior? > > W > > On Thursday, February

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

2013-02-22 Thread wwwgong
yes, that is a better solution and works! on a different topic, I notice you have many posts on smartgrid, I like to use smartgrid too, but do you agree that documentation or example usage on it is somewhat lacking? Thanks, W On Friday, February 22, 2013 11:37:58 AM UTC-5, Jim S wrote: > > The

[web2py] Re: Tip

2013-02-22 Thread Anthony
Did you look into CASfor that? On Friday, February 22, 2013 11:11:54 AM UTC-5, __pyslan__ wrote: > > Hello everybody! > > Well, I still have not solved the problem with stored procedures in MySQL, > but I need to cont

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

2013-02-22 Thread Jim Steil
I've been working with the smartgrid since Massimo created it. The way I learned most about it was to open up sqlhtml.py in my editor and look through the source, primarily at the parameters that you can pass to it. There is a great deal of capability and flexibility build into it. So, I agree,

Re: [web2py] Re: Tip

2013-02-22 Thread __pyslan__ - Ayslan Jenken
No. .. I analyzed the code of gluon.tools.py, gluon.validators.py and gluon.dal.py. The application I used the code mentioned is a server for two mobile applications. I don't know much about CAS... sorry. On Fri, Feb 22, 2013 at 1:58 PM, Anthony wrote: > Did you look into > CAS

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

2013-02-22 Thread wwwgong
I started to read sqlhtml.py too since yesterday yes, this group is very supportive, I am going to stick with web2py for a long while Thanks for your help Wen On Friday, February 22, 2013 12:09:20 PM UTC-5, Jim S wrote: > > I've been working with the smartgrid since Massimo created it. The way I

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

2013-02-22 Thread greaneym
Thank you. I've upgraded to v2.3.2 on the server and then tried two different local routes.py I tried adding this routes.py in the app "ablog" directory routes_in = ( ('/admin/$anything', '/admin/$anything'), ('/appadmin/$anything', '/myapp/appadmin/$anything'), ('/blog','/ablog/default/in

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

2013-02-22 Thread Jonathan Lundell
On 22 Feb 2013, at 10:01 AM, greaneym wrote: > Thank you. I've upgraded to v2.3.2 on the server and then tried two different > local routes.py > > I tried adding this routes.py in the app "ablog" directory > > routes_in = ( > ('/admin/$anything', '/admin/$anything'), > ('/appadmin/$anything

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

2013-02-22 Thread Alex Glaros
There is a grandparent (HumanLanguage), parent (DictionaryType), child (Word), relationship. If I go straight from the grandparent to the child, "represent" works. (First I click on HumanLangages, then I click on Word) If I go from the parent to the child, I get this message: () takes exactl

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

2013-02-22 Thread Alex Glaros
I've added another represent HumanLanguage "name" to represent HumanLanguage "ID" in the Word table, and it works correctly. Same table, same everything, so I will see if there's any differences in what I'm doing. Alex On Friday, February 22, 2013 10:08:04 AM UTC-8, Alex Glaros wrote: > > The

Re: [web2py] How to update web app on server without change the data already in database

2013-02-22 Thread animnook
Thanks. -- --- 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 options, visit https://groups.google.com/groups/opt_o

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

2013-02-22 Thread Jim Steil
Sorry, I'm kinda lost in what you're trying to do. Can you show it in code or screen shots? -Jim On Fri, Feb 22, 2013 at 12:08 PM, Alex Glaros wrote: > There is a grandparent (HumanLanguage), parent (DictionaryType), child > (Word), relationship. If I go straight from the grandparent to the

Re: [web2py] Re: auth.settings.login_next has no functionality?

2013-02-22 Thread Alan Etkin
> > Anthony, I did try with URL('profile', 'index') but got some looping > error which Firefox picked up… > I tried a bare new app with Version 2.4.1-alpha.2+timestamp.2013.02.22.10.18.20 Added this line below the default auth.settings section in db.py auth.settings.login_next = URL("blah")

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

2013-02-22 Thread Alex Glaros
thanks for offering to take a look. Screen shots here: https://docs.google.com/document/d/1e517YRN8FK08vqsVWmp1UuZ0LLevCNlkrhWyCkBQ7uQ/edit?usp=sharing Alex On Friday, February 22, 2013 12:16:39 PM UTC-8, Jim S wrote: > > Sorry, I'm kinda lost in what you're trying to do. Can you show it in

Re: [web2py] Re: lot's of X's in error responses

2013-02-22 Thread howesc
here's the current diff against trunk to remove those X's. :) diff -r 5d9a66496e58 gluon/http.py --- a/gluon/http.py Fri Feb 22 10:18:58 2013 -0600 +++ b/gluon/http.py Fri Feb 22 12:50:11 2013 -0800 @@ -97,9 +97,6 @@ if not body: body = status if

Re: [web2py] Re: auth.settings.login_next has no functionality?

2013-02-22 Thread Anthony
How did you get to this URL: http://localhost:8000/newapp/default/user/login?_next=/newapp/default/index? auth.settings.login_next does not work by adding a _next variable to URLs (in that case, it would only have an effect in generating URLs). Rather, it is the default post-login redirect URL

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

2013-02-22 Thread Jim Steil
Ouch, I'm going to have to defer to to someone who understands smartgrid better than I do. You've got me stumped on this one. On Fri, Feb 22, 2013 at 2:48 PM, Alex Glaros wrote: > thanks for offering to take a look. > > Screen shots here: > https://docs.google.com/document/d/1e517YRN8FK08vqsVW

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

2013-02-22 Thread greaneym
Thanks for your response. I added the missing colon, and then reloaded the routes. When I go to www.xxx.com and then use the menu to get to the blog, it does not route to xxx-yyy.abc.com/blog. It still routes to www.xxx.com/blog, so I don't believe the local routes.py is working yet. Do you

[web2py] Re: database validation on models or controllers side

2013-02-22 Thread 黄祥
a, i understand right now, thanks a lot for your detail explaination niphlod. -- --- 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...@googlegro

[web2py] smartgrid breadcrums not displaying Id when details=False

2013-02-22 Thread wwwgong
found from sqlhtml.py that smartgrid breadcrums displays Row Id only if details=True: if kwargs.get('details', True): breadcrumbs.append( LI(A(name, _class=trap_class(), _href=url(args=['view',

[web2py] Re: web2py under GAE: disabling indexes

2013-02-22 Thread howesc
thanks for the link. i'll try and take a look this weekend and see if there is a place for that in the DAL (feel free to open gluon/dal.py yourself too). yup, i'm paying more for writes right now then i am for instance hours per day on my largest paid application. :) cfh On Thursday, Februa

Re: [web2py] Re: auth.settings.login_next has no functionality?

2013-02-22 Thread Alan Etkin
> > How did you get to this URL: > http://localhost:8000/newapp/default/user/login?_next=/newapp/default/index > ? By clicking in a navbar link :P. I didn't know about the navbar by default in the layout. So one way of having auth to use the auth.settings ._next values is to set the referrer_

[web2py] Re: web2py under GAE: disabling indexes

2013-02-22 Thread Scott Hunter
If I had to guess, I'd say a patch is needed in the loop over the fields in create_table, that would add a new entry to the dict for the field definition based on a new attribute (which would be ignored for anything other than Google's Datastore) which gets added to sql_fields; then migrate_tab

[web2py] Web2py for full site - novice question

2013-02-22 Thread adohertyd
I'm familiar with web2py for building a web app and I have no problem with it but I'm now looking at building my own complete website which will have a structure as follows: 1. Home page: Small bio and introduction along with recent tweets, blog posts, news stories etc 2. Portfolio page: portfo

[web2py] Re: Web2py for full site - novice question

2013-02-22 Thread Massimo Di Pierro
You can do all of this using the built-in wiki. Just clone the "welcome" app and replace index() with def index(): return auth.wiki() On Friday, 22 February 2013 18:31:52 UTC-6, adohertyd wrote: > > I'm familiar with web2py for building a web app and I have no problem with > it but I'm now lo

[web2py] How to correctly link from a grid to a smartgrid? Getting 404 NOT FOUND

2013-02-22 Thread Kyle Flanagan
I'm getting a 404 NOT FOUND error whenever I try to use a smartgrid which is linked to from a grid. I just started using web2py about two days ago, so I might be totally missing something here. I currently have an SQLFORM.grid on one page with a link to another smartgrid. The link is defined in

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

2013-02-22 Thread Kyle Flanagan
Have you tried adding a format to your tables and defining your tables using objects instead of 'reference...'? I'm no web2py expert by any means, but I had a similar situation and when I changed the reference for my foreign id to db.other_table instead of 'reference other_table,' the format de

[web2py] I need a double entry accounting software ....

2013-02-22 Thread Massimo Di Pierro
... so I wrote this: https://github.com/mdipierro/pacioli It is a clone of http://furius.ca/beancount/. It is not based on web2py but it is implemented as a library and it can easily be integrated with web2py to make an ERP for example. Beancount is GPL while pacioli is BSD. It takes as input a

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

2013-02-22 Thread Alex Glaros
thanks for giving it a shot but depending upon whether I use quotes or not, either the data column disappears from the web page or I get errors On Fri, Feb 22, 2013 at 1:47 PM, Kyle Flanagan wrote: > Have you tried adding a format to your tables and defining your tables > using objects instead of

[web2py] Re: I need a double entry accounting software ....

2013-02-22 Thread 黄祥
very nice, i'm interesting in it, i am trying to built an simple erp in web2py too, but don't know how to do it. i learned the erp mechanism like in https://www.erpag.com, hope can be built it on web2py. -- --- You received this message because you are subscribed to the Google Groups "web2py

[web2py] ask about database and requires

2013-02-22 Thread 黄祥
hi, i found that : 1. notnull=True is not work without requires=IS_NOT_EMPTY() 2. length is not work without requires=IS_LENGTH() 3. uuid is not work in unique=True is it normal or a bug? for example: *#models* db.define_table('sale', Field('invoice_no', length=30, notnull=True), Field('

[web2py] asterik addition in fields of form CRUD

2013-02-22 Thread waqasiqbal . knysys
i want to add asterik in front of all mandotry fields , but problem is that form is built in CRUD ,so how can i add asterik i made module off asterik addition but it's not printing in its accurate location . Example: UserName: *[--] i want this asterik at this position an