Re: [web2py] Re: Grid takes an awful long time to show result.

2013-09-05 Thread Johann Spies
On 4 September 2013 15:34, Massimo Di Pierro wrote: > Please check with the response.toolbar to see if there is are hidden > recursive queries. > > Thanks! I did not use the 'db stats' function before when debugging and it seems a useful tool! Interestingly the difference is the following: Whe

[web2py] Re: Invalid request with special chars in URL

2013-09-05 Thread Wonton
Hello Marcio, First of all, thank you so much for your answer, I haven thought on that possibility and it's very interesting. However, I have a huge number of services and I often test them manually, so I would like to maintain the URLs as readable as possible. I would like to try first with t

Re: [web2py] sqlform.grid query question

2013-09-05 Thread António Ramos
Going with SQLTABLE i have my rows queried like count1=db.card_logs.id.count() (db.)select(db.trabalhador.nome,db.trabalhador.area,count1,groupby=db.trabalhador.nome, *having =(count1 % 2 = 1)*) the *having* clause is not accepted , how to do it to query only odd counts? I use sqlite!

Re: [web2py] sqlform.grid query question

2013-09-05 Thread António Ramos
Bingo! having =(count1 % 2* *==* *1) 2013/9/5 António Ramos > Going with SQLTABLE i have my rows queried like > > count1=db.card_logs.id.count() > > (db.)select(db.trabalhador.nome,db.trabalhador.area,count1,groupby=db.trabalhador.nome, > *having =(count1 % 2 = 1)*) > > > the *having* c

[web2py] Re: scheduler - Get task id for current task

2013-09-05 Thread Manoj Kumar M
Well, after some digging into source code I found the solution. In gluon/scheduler.py, def executor(queue, task, out): W2P_TASK = Storage({'id' : task.task_id, 'uuid' : task.uuid}) _env.update({'W2P_TASK' : W2P_TASK}) W2P_TASK is an environment variable. So, to get the task id, task_

[web2py] wizard issue? (db.define_table settings for the "db.auth_user is missing)

2013-09-05 Thread אבי אברמוביץ
Hi, I created a new app using the wizard. All looks good except for one thing: On the models/db.wizard, I don't see the db.define_table settings for the " db.auth_user. Should it be somewhere else or should I add it? Thanks. -- --- You received this message because you are subscribed to the Go

Re: [web2py] Re: Grid takes an awful long time to show result.

2013-09-05 Thread villas
Hi Johann I think this is related: https://groups.google.com/forum/?fromgroups=#!topic/web2py-developers/2SjrZ3AHR1c Using recursive queries which fetch the whole row (especially with very wide rows) is a huge DB hit. My conclusion is that, ideally, web2py should use joins where necessary.

[web2py] Re: TypeError: %d format: a number is required, not dict

2013-09-05 Thread Massimo Di Pierro
Please try trunk or nightly build. I believe this is fixed. On Thursday, 5 September 2013 00:42:04 UTC-5, Annet wrote: > > > > Version 2.5.1-stable+timestamp.2013.06.06.15.39.19 > > > Kind regards, > > Annet > -- --- You received this message because you are subscribed to the Google Groups "w

[web2py] Re: wizard issue? (db.define_table settings for the "db.auth_user is missing)

2013-09-05 Thread Massimo Di Pierro
auth.define_tables() creates all the auth_* tables. On Thursday, 5 September 2013 06:18:28 UTC-5, אבי אברמוביץ wrote: > > Hi, > I created a new app using the wizard. > All looks good except for one thing: > On the models/db.wizard, I don't see the db.define_table settings for the " > db.auth_user.

[web2py] Re: wizard issue? (db.define_table settings for the "db.auth_user is missing)

2013-09-05 Thread אבי אברמוביץ
Thanks , not sure I understand. In order to add fields, or update fields which were created, I need to add this to the wizard.db and edit from there? (not all the fields I created with the wizard to that table were created.) auth.define_tables('t_auth_user', Field('f_user_name', type='strin

Re: [web2py] sqlform.grid query question

2013-09-05 Thread Richard Vézina
Good! Richard On Thu, Sep 5, 2013 at 5:55 AM, António Ramos wrote: > Bingo! > having =(count1 % 2* *==* *1) > > > 2013/9/5 António Ramos > >> Going with SQLTABLE i have my rows queried like >> >> count1=db.card_logs.id.count() >> >> (db.)select(db.trabalhador.nome,db.trabalhador.area,

Re: [web2py] Invalid request with special chars in URL

2013-09-05 Thread Jonathan Lundell
On 5 Sep 2013, at 12:11 AM, Wonton wrote: > Hello Marcio, > > First of all, thank you so much for your answer, I haven thought on that > possibility and it's very interesting. > > However, I have a huge number of services and I often test them manually, so > I would like to maintain the URLs a

[web2py] CAS consumer as CAS provider

2013-09-05 Thread Imran Ahmed
Can we use one CAS consumer as a CAS provider for other app? -- --- 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

[web2py] understanding problem - use models or classes?

2013-09-05 Thread Andreas Wienes
Hello, I'm new to web2py and python and currently try to build a small application just for learning purposes. Now I struggle because I don't know if my solution is the right way doing it. I got three models called project, project_type and steps. A project belongs to a certain project_type an

[web2py] Re: SQLFORM.factory requires explicit uploadfolder

2013-09-05 Thread Alan Etkin
> In that case, how will you determine the absolute folder path? It seems there's no way, unless the field class reads request.folder which will be not always available. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from

[web2py] Re: glyphicon fonts served as text/html

2013-09-05 Thread k0aun9
Oh, I found the problem. When I uploaded the files, all the hyphens in the file names were converted to underscores automatically. Is it by design or bug? On Friday, September 6, 2013 1:44:08 AM UTC+8, k0aun9 wrote: > > I'm trying to come up with my own layout.html > > Instead of using web2py_bo

[web2py] glyphicon fonts served as text/html

2013-09-05 Thread k0aun9
I'm trying to come up with my own layout.html Instead of using web2py_bootstrap.css, I'm using the bootstrap.css (3.0) because I want to learn how things were built up and the differences. I uploaded the glyphicon fonts and svg etc (which comes with bootstrap dist) to /[myapp]/static/fonts/ In

[web2py] Re: understanding problem - use models or classes?

2013-09-05 Thread Niphlod
let's take a different POV: even if you work with classes, where should you store your "objects", and with what ? web2py ships with DAL that is not an ORM like in other frameworks. The "classes" paradigm can be adopted too but it's usually an extra step that can be beneficial only in huge apps w

[web2py] how to create and or alter a rows object on the fly

2013-09-05 Thread keiser1080
Hi, I need to use a smartgrid to show a mix of data comming from multiple source like database and webservices, because it's very easy to search, filter ect... a smartgrid. In my application i will first query my database, and then for each row i will query a a service and add some colums. It

[web2py] Re: scheduler - Get task id for current task

2013-09-05 Thread Niphlod
whoopsie, sorry: I thought that was documented :D /me takes a note and adds to the todo-list On Thursday, September 5, 2013 12:46:39 PM UTC+2, Manoj Kumar M wrote: > > Well, after some digging into source code I found the solution. In > gluon/scheduler.py, > > def executor(queue, task, out): >

[web2py] Re: Odd behavior IS_UPPER()

2013-09-05 Thread Niphlod
what did you expect ? you are overwriting the requires attribute. requires either takes a single validator or a list of them: just append to requires instead of reassigning ^_^ On Thursday, September 5, 2013 10:21:48 PM UTC+2, greenpoise wrote: > > I was tweaking my tables to change the INPUT to

[web2py] Re: Odd behavior IS_UPPER()

2013-09-05 Thread greenpoise
:) thanks! On Thursday, September 5, 2013 1:25:27 PM UTC-7, Niphlod wrote: > > what did you expect ? you are overwriting the requires attribute. requires > either takes a single validator or a list of them: just append to requires > instead of reassigning ^_^ > > On Thursday, September 5, 20

[web2py] Odd behavior IS_UPPER()

2013-09-05 Thread greenpoise
I was tweaking my tables to change the INPUT to upper case. All the fields that I changed it to, worked except for one field. It has this: Field('seriesname',requires=IS_UPPER()) and then at the end of the table it has this: db.series.seriesname.requires = IS_NOT_IN_DB(db,db.series.seriesnam

[web2py] Re: SQLFORM.factory field's type and default properties are not working as expected

2013-09-05 Thread Niphlod
On Thursday, September 5, 2013 11:04:53 AM UTC+2, Gliese 581 g wrote: > > Hi, > > I have a cutom form which I am displaying using SQLFORM.factory as given > below: > > searchform=SQLFORM.factory( > Field('uid', 'integer', requires=[IS_LENGTH(15,15)]), > Field('uaccount','unic

[web2py] SQLFORM.factory field's type and default properties are not working as expected

2013-09-05 Thread Gliese 581 g
Hi, I have a cutom form which I am displaying using SQLFORM.factory as given below: searchform=SQLFORM.factory( Field('uid', 'integer', requires=[IS_LENGTH(15,15)]), Field('uaccount','unicode',default=None)) if searchform.accepts(request.vars): result=__get_payments()

Re: [web2py] LDAP with username=True can still login with email

2013-09-05 Thread Camille Roussel
Please excuse my ignorance on this as I am brand new to programming and web2py. For this issue what necessitates the need to store the bare username instead of potentially storing the full email or UPN? I know in our environment the sAMAccountName is not necessarily unique across the forest but

[web2py] Re: Is it possible to generate a file containing the update for book 4th to 5th?

2013-09-05 Thread Niphlod
> > BTW: Another enhancement request: would it be possible to display changes > ordered by date/time? > I completely missed this post, sorry. Now its correctly ordered ^_^ -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe

Re: [web2py] Re: Grid takes an awful long time to show result.

2013-09-05 Thread Anthony
> SELECT rresearch.nu, rresearch.ny, rresearch.nc, rresearch.id > > FROM rresearch > WHERE (rresearch.id IS NOT NULL) > ORDER BY rresearch.nu, rresearch.ny, rresearch.nc, rresearch.id; > > 2920.90ms > > The above query is not used for the grid. Rather, it is used to generate a dropdown list

Re: [web2py] Invalid request with special chars in URL

2013-09-05 Thread Wonton
Arrgh! I must be missing something, I'm very sorry :-(. I've tried this: - No changes. The site is working correctly except for the special chars. - I've created in web2py root directory the routes.py file with this content: routes_apps_raw=['myapp'] -I've restarted web2py. - My app is not wor

[web2py] add another grid in edit form using sqlform.grid

2013-09-05 Thread 黄祥
hi, i have a table invoice_header and invoice_detail, and i want to add invoice_detail grid in the invoice_header edit page. actually i want to combile what i see in web2pyslices http://www.web2pyslices.com/slice/show/1627/simple-online-invoices-with-invoice2py with http://www.web2pyslices.com/sl

[web2py] Specifying onvalidation with auth.profile() prevents default onaccepts method

2013-09-05 Thread Mark Li
Currently I am creating a form with auth.profile() I have an onvalidation method to perform some extra checks. form = auth.profile() if form.process(onvalidation=reauthenticate_user).accepted: response.flash = "Changes Saved" elif form.errors: response.flash = "Errors found This prev

[web2py] Field value based on other field in Dal?

2013-09-05 Thread greenpoise
is it possible to have an if statement of some sort in Dal to validate/add a value based on other field? like: db.define_table('product', Field('series', 'reference series'), Field('suppliercode','reference supplier'), Field('description'), Field('tiluse','reference tileuse'),

[web2py] How to change db servers (same underlying type)?

2013-09-05 Thread MichaelF
My application currently works fine, accessing a MySQL server on host H1 ("H1" is simply a name I've made up for this example.) I now want to start using MySQL on host H2 (hardware different from H1), same username and pwd. Once the tables/structure are created I'll just dump data from the serve

[web2py] Re: Force user to reenter password to save auth.profile() changes

2013-09-05 Thread 黄祥
just an idea, why not put this as default feature in web2py, i mean in default/user/profile. best regards, stifan On Saturday, August 10, 2013 3:18:59 PM UTC+7, Massimo Di Pierro wrote: > > This is what I would have done. Some caveats: > > 1) Use a SQLFORM.factory and not a SQLFORM because you d

[web2py] Re: CAS consumer as CAS provider

2013-09-05 Thread Massimo Di Pierro
I do not know. I never tried. But why? A consumer has a provider. Use the same provider for the third app. On Thursday, 5 September 2013 00:58:23 UTC-5, Imran Ahmed wrote: > > Can we use one CAS consumer as a CAS provider for other app? > -- --- You received this message because you are subsc

[web2py] Re: wizard issue? (db.define_table settings for the "db.auth_user is missing)

2013-09-05 Thread Massimo Di Pierro
I think you want this: http://www.web2py.com/books/default/chapter/29/09/access-control?search=extra_fields On Thursday, 5 September 2013 07:44:02 UTC-5, אבי אברמוביץ wrote: > > > Thanks , not sure I understand. In order to add fields, or update fields > which were created, I need to add this t

[web2py] Re: glyphicon fonts served as text/html

2013-09-05 Thread Massimo Di Pierro
yes. On Thursday, 5 September 2013 12:49:31 UTC-5, k0aun9 wrote: > > Oh, I found the problem. When I uploaded the files, all the hyphens in the > file names were converted to underscores automatically. > > Is it by design or bug? > > On Friday, September 6, 2013 1:44:08 AM UTC+8, k0aun9 wrote: >>

[web2py] Re: SQLFORM.factory requires explicit uploadfolder

2013-09-05 Thread Massimo Di Pierro
We could use current.request.folder but we would have to couple the dal code to current. that is something we avoided to far. On Thursday, 5 September 2013 11:31:36 UTC-5, Alan Etkin wrote: > > > In that case, how will you determine the absolute folder path? > > It seems there's no way, unless th

[web2py] Re: Specifying onvalidation with auth.profile() prevents default onaccepts method

2013-09-05 Thread Massimo Di Pierro
This form = auth.profile() form.process(onvalidation=reauthenticate_user) is wrong because auth.profile() already calls process inside. Instead you should do: auth.settings.profile_onvalidation.append(reauthenticate_user) form = auth.profile() On Thursday, 5 September 2013 17:42:18 UTC-5, Mark

[web2py] Adding jQuery effects back into a manual form

2013-09-05 Thread REM
I found it necessary to create a manual form, but I'd like to add back the cool default jQuery effects to report on validation errors for the one input field. Is there a quick way to access and pass these jQuery effects back in to my manual form? Here's the db definition: db = DAL('mysql://us

[web2py] Re: SQLFORM.factory requires explicit uploadfolder

2013-09-05 Thread Alan Etkin
> > We could use current.request.folder but we would have to couple the dal > code to current. that is something we avoided to far. > I don't think it is necessary to use current in dal just for this. I don't mind adding uploadfolder on each Field(...) call, I just was curious why it was neede

[web2py] Re: Force user to reenter password to save auth.profile() changes

2013-09-05 Thread Massimo Di Pierro
I agree. Please open a ticket. This can be done easily. On Thursday, 5 September 2013 18:38:36 UTC-5, 黄祥 wrote: > > just an idea, why not put this as default feature in web2py, i mean > in default/user/profile. > > best regards, > stifan > > On Saturday, August 10, 2013 3:18:59 PM UTC+7, Massimo

[web2py] Re: SQLFORM.factory requires explicit uploadfolder

2013-09-05 Thread Massimo Di Pierro
You can always define def UploadField(*a,**b): b['uploadfolder'] = request.folder return Field(*a,**b) db.define_table( UploadField(...)) I often define def HiddenField(*a,**b): b['readable'] = b['writable'] = False return Field(*a,**b) def ReadonlyField(*a,**b):

[web2py] Re: Field value based on other field in Dal?

2013-09-05 Thread Anthony
Does conversiontype need to be writable in forms? If not, you can use a computed field. If you are just trying to change the default value, you could do something like: Field('conversiontype','reference conversiontype', default=5 if request.vars.tiluse == 5 else 2) Note, that will only ch

[web2py] Re: Field value based on other field in Dal?

2013-09-05 Thread greenpoise
Thats exactly what I am looking! Thanks, will try and post Thanks Anthony On Thursday, September 5, 2013 6:31:46 PM UTC-7, Anthony wrote: > > Does conversiontype need to be writable in forms? If not, you can use a > computed field. If you are just trying to change the default value, you > coul

[web2py] Re: CAS consumer as CAS provider

2013-09-05 Thread Imran Ahmed
Previously, I have a state where I want third app to be CAS consumer of second app. Now I sorted it out. Thanks for support. Now using same provider for third app also. On Thursday, September 5, 2013 11:28:23 AM UTC+5:30, Imran Ahmed wrote: > > Can we use one CAS consumer as a CAS provider for ot

[web2py] Re: Force user to reenter password to save auth.profile() changes

2013-09-05 Thread 黄祥
done, Issue 1667 thanks and best regards, stifan On Friday, September 6, 2013 7:32:57 AM UTC+7, Massimo Di Pierro wrote: > > I agree. Please open a ticket. This can be done easily. > > On Thursday, 5 September 2013 18:38:36 UTC-5, 黄祥 wrote:

[web2py] web2py_win.zip redundant file during extracted

2013-09-05 Thread 黄祥
hi, i've downloaded the latest web2py_win.zip during extracted the zip file, it tells that the file on web2py\applications\examples\static\epydoc\gluon.html__tag__-class.html is already there. the file size is different. is it okay to replace it or keep it? thanks and best regards, stifan --

[web2py] Re: Specifying onvalidation with auth.profile() prevents default onaccepts method

2013-09-05 Thread Mark Li
Thanks Massimo. However, using auth.settings.profile_onvalidation.append(reauthenticate_user) has presented a problem of its own. I insert an extra field ("confirm_password"), to recheck in the onvalidation method. However, the form.vars does not contain form.vars.confirm_password, which worke