Re: [web2py] Re: Scheduler - a second try

2013-11-08 Thread Johann Spies
Postgresql On 7 November 2013 15:16, Niphlod niph...@gmail.com wrote: what db are you using ? On Thursday, November 7, 2013 12:07:40 PM UTC+1, Johann Spies wrote: It was a year ago that I have tried for 4 days to get the scheduler working. In the end I gave up and decided to use the

[web2py] Re: Converting python list into javascript array in views (web2py) ?

2013-11-08 Thread Alex
or use JSON.stringify to get the textual representation of the object. e.g. alert(JSON.stringify(t)); Am Donnerstag, 7. November 2013 21:46:36 UTC+1 schrieb Niphlod: oh my. json_object *IS* an object (the name should have been pretty obvious). if you want the value of a, just do

Re: [web2py] Re: Scheduler documentation question

2013-11-08 Thread Johann Spies
Thanks. Please put that in the book. On 7 November 2013 15:22, Niphlod niph...@gmail.com wrote: that if you have multiple workers you can have them assigned a multiple fraction of the work if you know that they'll process tasks faster. i.e. you have a local worker fetching from the

[web2py] Re: response.files.append and response.files.insert

2013-11-08 Thread Leonel Câmara
This is actually a python question. It's the same difference that there is for a python list between an append and an insert. Append always adds the item to the end of the list, insert puts the item in the position you requested (the first argument). In web2py terms the second version avoids

[web2py] Re: urllib2.HTTPError

2013-11-08 Thread Leonel Câmara
From what I could test the problem is that your query is wrong in one of those steps. Check exactly what you are putting there. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: R/W restrictions specific to a form

2013-11-08 Thread Leonel Câmara
The models get reloaded every request so you can just set the writable and readable attributes for the fields before creating the form and it will only affect this form. For instance you could add this before your call to SQLFORM.factory db.auth_user.email.writable =

Re: [web2py] Re: Web2py freezing on live deployment!

2013-11-08 Thread Tim Richardson
I had a puzzling problem with 2.7.4 as a rocket service on Windows 2003, but this was a problem with sqlform.grids. There was a print statement left in code which caused the service to stop working. This cause doesn't match with your insights into the problem, but I mention it anyway. You

[web2py] How to make registrations invitation-only with Janrain login/registrations

2013-11-08 Thread Dragan Matic
When using web2py authentication I can check if user is logging in or registering a new user and then I can check if it has proper invitation code in and deny him registration. But what if user is using Janrain? Login and registraton is then done through an external app. Is there a way to

Re: [web2py] Re: Web2py freezing on live deployment!

2013-11-08 Thread Andrew Buchan
Yes, I've been caught out by that quite a few times! Not a problem with Apached I may add, the wsgi file redirects stdout to show up in the apache error log, but I suppose you could point it anywhere really. On Fri, Nov 8, 2013 at 12:31 PM, Tim Richardson t...@growthpath.com.auwrote: I had a

[web2py] Re: Use view to generate a string

2013-11-08 Thread Leonel Câmara
I think what you want is a controller with a cached view, if it is then, check the example in the book http://web2py.com/book/default/chapter/04#cache for cache/view. Of course that if you explain more thoroughly what you are trying to do, other options may be better. Sexta-feira, 8 de

[web2py] Re: Use view to generate a string

2013-11-08 Thread Niphlod
response.render is what you're seeking for ... On Friday, November 8, 2013 3:49:14 AM UTC+1, Scott Hunter wrote: Is it possible to use a view to generate a string? In this particular case, I want to generate a snippet of HTML cache it away. I suppose this could be done using straight

Re: [web2py] Re: Scheduler - a second try

2013-11-08 Thread Niphlod
the only thing is that only syslog-ng is multiprocess-safe, so the standard logging to file and/or console may incur in problems. On Friday, November 8, 2013 5:46:29 AM UTC+1, Jonathan Lundell wrote: On 7 Nov 2013, at 7:05 PM, Andrew W awill...@gmail.com javascript: wrote: Thanks. I've

[web2py] Re: Use view to generate a string

2013-11-08 Thread Anthony
You can use the render() function: import os from gluon.template import render mytext = cache.ram('mytext', lambda: render(filename=os.path.join(request.folder, 'path', 'to', 'template.html')), time_expire=3600) If the template contains any {{include ...}}

Re: [web2py] OnSelect how to?

2013-11-08 Thread Richard Vézina
In the view with javascript you can do that : To set content of session.var you will need a python function for that, something like that : def __create_update_session_var(): id = request.vars.id value = request.vars.value session.var = id #or #session.var = value #or

[web2py] Re: Problems with response.view =

2013-11-08 Thread David
It is rendering the 'test.html' On Thursday, November 7, 2013 2:52:59 PM UTC-5, Niphlod wrote: put in your test.html an element and render the response.view value in it, so you'll know what actually is the response.view passed ... -- Resources: - http://web2py.com -

Re: [web2py] Scheduler - a second try

2013-11-08 Thread Jonathan Lundell
On 8 Nov 2013, at 5:45 AM, Niphlod niph...@gmail.com wrote: the only thing is that only syslog-ng is multiprocess-safe, so the standard logging to file and/or console may incur in problems. That applies to more than the scheduler, though, and using syslog isn't so bad. (Maybe we could add a

[web2py] Re: Use view to generate a string

2013-11-08 Thread Anthony
Good point. You can also use response.render(), which may be a bit simpler: mytext = cache.ram('mytext', lambda: response.render('path/to/template.html'), time_expire=3600) The path must be relative to the app's /views folder (you can use ../ to get out of

Re: [web2py] Custom login form error display

2013-11-08 Thread Ruud Schroen
I got the errors working. I forgot to use form.errors like you said. Do you guys also know of a way to show an error if the password is incorrect? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Problem getting auth.wiki('slug', env=dict(mytest=...)) to work in a view?

2013-11-08 Thread Chuck Paulson
After further experimentation, it seems the default is for the wiki page to get processed once when you submit it after editing. Further auth.wiki calls on that slug just retrieve the computed html, they do not do processing, hence the env argument is ignored. There is a force_render flag

[web2py] Web2py (2.7.4) not working on IE9

2013-11-08 Thread Luca Zacchetti
Web2py (version 2.7.4) forms are not working on my IE9 browser. Just tried with a fresh web2py installation and even the form to access to web2py admin interface is not working, it reloads itself without doing the login and every other forms in my app is doing the same. Do you also have this

[web2py] Re: Installing the jqmobile plugin

2013-11-08 Thread Philip Kilner
Hi All, On 07/11/13 18:30, Philip Kilner wrote: Found a note here: - https://groups.google.com/forum/#!topic/web2py/W9b3RZBrmYQ ...where Massimo says the posted plugin online is old and broken (I need to fix it).now a working version of plugin jquery comes with web2py. It is in admin.

[web2py] Re: I need help understanding an issue with SQLFORM.factory ( in the context of a form wizard )

2013-11-08 Thread Carlos Zenteno
Don, can you tell me how you made it work? I am not having any luck making it work and Anthony's answer has been deleted for some reason. thanks... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] development server slow

2013-11-08 Thread Vinicius Assef
Hi guys, I'm facing an issue: in my development environment, my browser stays waiting for static files (css and/or js) for a long time. It's not always, but it occurs *many* times. When I use nginx this doesn't happen. I'm using we2py 2.7.4, but his happens a long time in my ubuntu 12.04

Re: [web2py] development server slow

2013-11-08 Thread Ovidio Marinho
I think this happened to me yesterday while trying to put controls in my css bootstrap index.html * Acho que aconteceu isto comigo ontem quando tentei inserir controles do Bootstrap na minha index.html, travou. Ovidio Marinho Falcao Neto ITJP.NET.BR

[web2py] Autocomplete trigger callback function using ID

2013-11-08 Thread Ari Lion BR Sp
Dear All, I have searched in the list, without success. Is there a way to trigger a function after having filled Autocomplete (ID based) field? (If I would use simple SELECT field, it would be easy - doing a onchage, but onchange or onblur , but I have a very large database of products,

[web2py] Re: Web2py (2.7.4) not working on IE9

2013-11-08 Thread Massimo Di Pierro
Can you isolate the problem? On Friday, 8 November 2013 10:44:02 UTC-6, Luca Zacchetti wrote: Web2py (version 2.7.4) forms are not working on my IE9 browser. Just tried with a fresh web2py installation and even the form to access to web2py admin interface is not working, it reloads itself

Re: [web2py] Re: Web2py (2.7.4) not working on IE9

2013-11-08 Thread Michele Comitini
cookies? 2013/11/8 Massimo Di Pierro massimo.dipie...@gmail.com Can you isolate the problem? On Friday, 8 November 2013 10:44:02 UTC-6, Luca Zacchetti wrote: Web2py (version 2.7.4) forms are not working on my IE9 browser. Just tried with a fresh web2py installation and even the form to

Re: [web2py] Re: I need help understanding an issue with SQLFORM.factory ( in the context of a form wizard )

2013-11-08 Thread Richard Vézina
Anthony's answer : https://groups.google.com/d/msg/web2py/AVes-nFhxnw/nF9J1tEo6_QJ On Fri, Nov 8, 2013 at 12:36 PM, Carlos Zenteno cmzent...@gmail.com wrote: Don, can you tell me how you made it work? I am not having any luck making it work and Anthony's answer has been deleted for some

[web2py] Re: urllib2.HTTPError

2013-11-08 Thread sonu kumar
I checked my query it is working fine but I found error sometime when I run responsemmpn = urllib2.urlopen(requestmmpn) In first go it throws below error but second time I run this same command it works fine for me. Why this is happening?? Traceback (most recent call last): File stdin, line

Re: [web2py] Re: I need help understanding an issue with SQLFORM.factory ( in the context of a form wizard )

2013-11-08 Thread Anthony
That answer is still on Google Groups. The message that was deleted was another message from Don_X and didn't appear to contain anything relevant to the problem solution. Anthony On Friday, November 8, 2013 1:41:00 PM UTC-5, Richard wrote: Anthony's answer :

Re: [web2py] Scheduler - a second try

2013-11-08 Thread Niphlod
of course the syslog-ng makes sense only for the scheduler (but, if you're using uwsgi with multiple processes, syslog-ng is the only handler that works without issues, for the exact same limitation) Logging into database (if not something like mongodb co.) seems a little bit daunting, given

[web2py] Re: Problems with response.view =

2013-11-08 Thread Niphlod
if so, there's a piece of your code resetting the response.view call. Please attach a minimal app to reproduce the issue. On Friday, November 8, 2013 3:24:52 PM UTC+1, David wrote: It is rendering the 'test.html' On Thursday, November 7, 2013 2:52:59 PM UTC-5, Niphlod wrote: put in your

[web2py] Re: urllib2.HTTPError

2013-11-08 Thread Leonel Câmara
Probably the server is doing the redirect wrong. I would use something like this http://stackoverflow.com/questions/554446/how-do-i-prevent-pythons-urllib2-from-following-a-redirect To further inspect what's going on. Check the location you get in the 302. -- Resources: - http://web2py.com -

[web2py] is this possible db.table(id).field.represent

2013-11-08 Thread Richard
Hello, How can I do this : db.table(id).field.represent Could a short cut be created to handle this use case? {{=form.custom.begin}} table class=table table-condensed table-hover theadtrth{{=T('Field label')}}/th/tr/thead tbody {{for r in rows:}} tr

[web2py] Re: Improving database performance

2013-11-08 Thread Jim S
Can you post some code to review? -Jim On Thursday, November 7, 2013 4:45:25 AM UTC-6, Arto Huhtala wrote: Hi, I am developing a test application with web2py to test database performance. The idea is to see how long does it take to fetch information from database on different loads. So

Re: [web2py] is this possible db.table(id).field.represent

2013-11-08 Thread Anthony
Are you saying you want the represent function applied specifically to a reference field? Note, a Row object does not know with what DAL table it is associated, so it can't automatically apply the represent attributes of its fields. However, the Rows object has a new .render() method for this

Re: [web2py] Scheduler - a second try

2013-11-08 Thread Jonathan Lundell
On 8 Nov 2013, at 11:40 AM, Niphlod niph...@gmail.com wrote: of course the syslog-ng makes sense only for the scheduler (but, if you're using uwsgi with multiple processes, syslog-ng is the only handler that works without issues, for the exact same limitation) Logging into database (if not

[web2py] AD LDAP Auth without creating Auth tables

2013-11-08 Thread GregD
We want to perform AD Auth but Web2Py seems to need to create the Auth Tables OR it want to see existing Auth tables. Our problem is that we're using an older database Firebird 1.5 and can't seem to get Web2Py to recognize Auth tables from that database. Is there a way to do AD Auth without

[web2py] Re: response.files.append and response.files.insert

2013-11-08 Thread 黄祥
thank you so much for your detail explaination leonel. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message

Re: [web2py] Re: R/W restrictions specific to a form

2013-11-08 Thread Kiran Subbaraman
Leonel, Thanks. Will try this out. Wasn't aware of auth.settings.passfield; any documentation around this? Looked for this here: http://web2py.com/books/default/chapter/29/09/access-control#Settings-and-messages Finally, any thoughts on Also, factory seems to create a SQLFORM which does not

Re: [web2py] Re: smartgrid divided in columns

2013-11-08 Thread kwebb
I know this is an older post. Is it now possible to user radio buttons in smartgrid? The documentation on this is light. Many thanks! Kris On Wednesday, August 8, 2012 1:21:28 AM UTC-6, Johann Spies wrote: On 7 August 2012 15:40, Martin Weissenboeck mwei...@gmail.comjavascript: wrote:

[web2py] Re: retrieve auth_group.role from auth_user table

2013-11-08 Thread 黄祥
why the same query not work when i use it on smartgrid? e.g. def report_doctor(): query = ( (db.auth_user.id == db.auth_membership.user_id) (db.auth_membership.group_id == db.auth_group.id) (db.auth_group.role.like('doctor')) ) #constraints = dict(auth_user = query) constraints = {'auth_user' :

[web2py] Re: Problem getting auth.wiki('slug', env=dict(mytest=...)) to work in a view?

2013-11-08 Thread Dave S
On Friday, November 8, 2013 7:43:19 AM UTC-8, Chuck Paulson wrote: After further experimentation, it seems the default is for the wiki page to get processed once when you submit it after editing. Further auth.wiki calls on that slug just retrieve the computed html, they do not do

[web2py] Re: Improving database performance

2013-11-08 Thread Paolo Valleri
Hi, if the index is slow with 100k dummy data you should create an index and on the other hand review your code. Create indexes on columns used by the query that generates the index; for what concerns the query, can you please post that code? Finally, be aware that for the moment you should