[web2py] Re: controller return list instead of string or dict

2013-07-30 Thread Niphlod
can you explain better what's going on ? the generic json view (as any other view) is made to serialize a python object to something (in json's case, a json string). If you already return a string because your code encodes it already, than you don't need any view, because the job the view

Re: [web2py] Re: A good py Logger Lib that works with web2Py (like Log4J)

2013-07-30 Thread Jake Angulo
Thanks All! Will try to both pdb and errormator and see what works for me. On Tue, Jul 30, 2013 at 3:50 AM, Derek sp1d...@gmail.com wrote: Take a look at errormator. I use it in some of my non-web2py apps simple enough. On Sunday, July 28, 2013 5:51:28 PM UTC-7, Jake Angulo wrote: Hi

[web2py] Re: how to create a readonly connection to remote db

2013-07-30 Thread Monika Yadav
On Monday, July 29, 2013 7:33:21 PM UTC+5:30, Niphlod wrote: there's no default read-only in client-side libraries that connects to a database. What do you need specifically ? On Monday, July 29, 2013 1:49:11 PM UTC+2, Monika Yadav wrote: how to create a readonly connection to remote db

[web2py] Re: how to create a readonly connection to remote db

2013-07-30 Thread Niphlod
even if you just read a table and you want to read that table with a DAL select, you need to code the model in your application. just set migrate=False on the table definitions if tables are already there, and DAL will be happy to work with them On Tuesday, July 30, 2013 7:42:54 AM UTC+2,

[web2py] Re: How write subquery of LEFT JOIN using DAL?

2013-07-30 Thread Massimo Di Pierro
You cannot do this with DAL in one query but there may be other ways. What is you model? Do this table have an id field? If I understand in english: - you have a table called value with fields indicator, client_date, value, checked - you first select all distinct values of indicator and for

[web2py] Re: I have some questions about Central Authorization Service (CAS)

2013-07-30 Thread Massimo Di Pierro
When you visit the forum page if the corresponding requires_login() than it would automatically redirect to myapp (check that you are logged in) and back as you expect. But if you visit an action that does not require login, web2py does not assume that you need to be logged in and does not

[web2py] Re: How to create a hyperlink from a display field in sqlForm?

2013-07-30 Thread Alex Glaros
any hints would be appreciated! On Sunday, July 28, 2013 4:55:53 AM UTC-7, Alex Glaros wrote: How do I create a hyperlink back to parent record ObjectSuperType.id from displayed field db.TaxonomyDetail.objected below? The link would take user to the controller that displays parent table

[web2py] Re: python 3.3.2

2013-07-30 Thread Mirek Zvolský
do I need some additional plugins to hook it up to my existing mysql db Just write a connection string and table description in your model file - 6th chapter of book describes this. However in web2py all tables have autoincrement integer primary key called id. This field will be added

Re: [web2py] Re: How to create a hyperlink from a display field in sqlForm?

2013-07-30 Thread Johann Spies
Here is an example of what I did yesterday. Maybe that will give you a hint: Field(url, represent = lambda x, record: A('click here for website', _target = _blank, _href = x)) , In the grid the url column shows a link. Regards Johann -- Because experiencing your loyal

[web2py] Problem with virtual field

2013-07-30 Thread Eduardo Cruz
Hi, I have this table db.define_table('station', dates, Field('name', 'string', unique=True), Field('average_time', 'integer'), Field('area_id', 'reference area', requires=IS_IN_DB(db, 'area.id', '%(name)s') ,label=Area,

[web2py] Re: controller return list instead of string or dict

2013-07-30 Thread Matt
We've got a controller with a restful method (using the @request.restful decorator), which makes calls over a json rpc socket and then returns the result. Sometimes the result of the json rpc call is a list of strings, which is properly converted back into python as a list type. When we do

[web2py] auth.user_groups are cached? Can't see changes beeing done in admin UI until user logout/login again

2013-07-30 Thread David Marko
auth.user_groups are cached? Cant see changes beeing done in admin UI until user logout/login again . Any idea how to make this information to be fresh? I mean when I remove user from group, it should be working immediately ... -- --- You received this message because you are subscribed to

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Jonathan Lundell
On 30 Jul 2013, at 12:22 AM, Niphlod niph...@gmail.com wrote: can you explain better what's going on ? the generic json view (as any other view) is made to serialize a python object to something (in json's case, a json string). If you already return a string because your code encodes it

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Matt
On Tuesday, July 30, 2013 10:26:45 AM UTC-4, Jonathan Lundell wrote: On 30 Jul 2013, at 12:22 AM, Niphlod nip...@gmail.com javascript: wrote: can you explain better what's going on ? the generic json view (as any other view) is made to serialize a python object to something (in json's

[web2py] Re: auth.user_groups are cached? Can't see changes beeing done in admin UI until user logout/login again

2013-07-30 Thread Massimo Di Pierro
Yes they are cached. You can call auth.update_groups() at every request to make sure the groups are updated but this is a lot of extra DB IO. On Tuesday, 30 July 2013 08:55:13 UTC-5, David Marko wrote: auth.user_groups are cached? Cant see changes beeing done in admin UI until user

[web2py] Re: auth.user_groups are cached? Can't see changes beeing done in admin UI until user logout/login again

2013-07-30 Thread Anthony
On Tuesday, July 30, 2013 10:49:29 AM UTC-4, Massimo Di Pierro wrote: Yes they are cached. You can call auth.update_groups() at every request to make sure the groups are updated but this is a lot of extra DB IO. Maybe use the DAL table callbacks to call auth.update_groups() only when

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Anthony
Can you show your code? You say you return locals(), but locals() produces a dictionary, so it should ultimately execute a view. Or are you just returning the list directly? Anthony On Tuesday, July 30, 2013 10:28:53 AM UTC-4, Matt wrote: On Tuesday, July 30, 2013 10:26:45 AM UTC-4,

Re: [web2py] Re: How to create a hyperlink from a display field in sqlForm?

2013-07-30 Thread Alex Glaros
can you please map out a descriptions of the parms and where they come from? What is the x, record, A? thanks! Alex On Tuesday, July 30, 2013 5:23:50 AM UTC-7, Johann Spies wrote: Here is an example of what I did yesterday. Maybe that will give you a hint: Field(url, represent = lambda

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Jonathan Lundell
On 30 Jul 2013, at 8:34 AM, Anthony abasta...@gmail.com wrote: Can you show your code? You say you return locals(), but locals() produces a dictionary, so it should ultimately execute a view. Or are you just returning the list directly? A list directly (see the code fragment below). Since

Re: [web2py] Re: How to create a hyperlink from a display field in sqlForm?

2013-07-30 Thread Alex Glaros
Okay...I have this so far db.TaxonomyDetail.objectID.represent = lambda ObjectSuperType,record : A(db.TaxonomyDetail.objectID, _target = _blank, _href = 'manage_object_super_type') But 1. record: A(db.TaxonomyDetail.objectID displays literally instead of the field contents 2. Link

[web2py] Re: auth.user_groups are cached? Can't see changes beeing done in admin UI until user logout/login again

2013-07-30 Thread David Marko
But update_groups do update only for just login user so callbacks should do the work for every user, and this probably cant be done ... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving

[web2py] Problem with virtual field

2013-07-30 Thread Loïc
Did you try Field.Virtual('area_name', lambda row: db.area(row.area_id).name), ? -- --- 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 financing

2013-07-30 Thread Alex
I'm wondering how web2py is financed. Is it somehow financed from the University? Or is everyone only working in his spare time? That would be hard to believe for such a great framework. Do you take donations? regards, Alex -- --- You received this message because you are subscribed to the

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Matt
On Tuesday, July 30, 2013 11:51:08 AM UTC-4, Jonathan Lundell wrote: On 30 Jul 2013, at 8:34 AM, Anthony abas...@gmail.com javascript: wrote: Can you show your code? You say you return locals(), but locals() produces a dictionary, so it should ultimately execute a view. Or are you just

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Matt Broadstone
On Tue, Jul 30, 2013 at 2:11 PM, Matt mbroa...@gmail.com wrote: On Tuesday, July 30, 2013 11:51:08 AM UTC-4, Jonathan Lundell wrote: On 30 Jul 2013, at 8:34 AM, Anthony abas...@gmail.com wrote: Can you show your code? You say you return locals(), but locals() produces a dictionary, so it

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Matt Broadstone
On Tue, Jul 30, 2013 at 2:14 PM, Alan Etkin spame...@gmail.com wrote: The question is: what should happen when a controller returns a list? The JSON serializer is happy to serialize a list. Is there any downside in doing it? Does it make any sense right now for a controller to return a

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Alan Etkin
The question is: what should happen when a controller returns a list? The JSON serializer is happy to serialize a list. Is there any downside in doing it? Does it make any sense right now for a controller to return a list? It would be inconsistent with this documented part of the

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Anthony
@request.restful() def jsonlisttest(): response.view = 'generic.json' def GET(*args, **vars): sample_raw_rpc_response = '[one, two, three]' sample_rpc_response = simplejson.loads(sample_raw_rpc_response) return sample_rpc_response Looks like you're starting

[web2py][share] Select2.js

2013-07-30 Thread Richard
Hello, I just found this (select2.js) : http://ivaynberg.github.io/select2/index.html A kind of chosen on steroïd... It include a Tagging utility that let insert new tag on the fly like Tag-it but don't seem to require jQuery UI. Enjoy. Richard -- --- You received this message because

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Matt Broadstone
On Tue, Jul 30, 2013 at 2:26 PM, Anthony abasta...@gmail.com wrote: @request.restful() def jsonlisttest(): response.view = 'generic.json' def GET(*args, **vars): sample_raw_rpc_response = '[one, two, three]' sample_rpc_response =

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Anthony
So the advice is to make generic-list.json, and force that view, expecting that the input is in some format we decide upon. e.g. instead of returning sample_rpc_response, we return dict(result=sample_rpc_response)? You could do that, but see my other response. Anthony -- --- You

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Matt Broadstone
On Tue, Jul 30, 2013 at 2:31 PM, Anthony abasta...@gmail.com wrote: So the advice is to make generic-list.json, and force that view, expecting that the input is in some format we decide upon. e.g. instead of returning sample_rpc_response, we return dict(result=sample_rpc_**response)? You

[web2py] Re: auth.user_groups are cached? Can't see changes beeing done in admin UI until user logout/login again

2013-07-30 Thread Anthony
Oops, sorry, wasn't thinking. I suppose you could do something more sophisticated like store the affected user IDs in cache.ram and do a check there on each request. Anthony On Tuesday, July 30, 2013 1:28:13 PM UTC-4, David Marko wrote: But update_groups do update only for just login user so

Re: [web2py] controller return list instead of string or dict

2013-07-30 Thread Anthony
Why not: def GET(*args, **vars): sample_raw_rpc_response = '[one, two, three]' sample_rpc_response = simplejson.loads(sample_raw_rpc_response) result = someOtherOperationThatCanPOTENTIALLYReturnAList( sample_rpc_response) return simplejson.dumps(result) Or if

[web2py] Re: python 3.3.2

2013-07-30 Thread D Dan
Is there a way we could share these things (db.py models and modules across applications?) Currently we share databases across applications. IT is a bit tedious to copy schema definitions to many applications. Thanks On Sunday, July 28, 2013 1:54:03 AM UTC-7, Massimo Di Pierro wrote:

[web2py] Re: python 3.3.2

2013-07-30 Thread Alan Etkin
You can share the schema across different apps by serving and requesting it in json or yaml format: Is there a way we could share these things (db.py models and modules across applications?) Currently we share databases across applications. IT is a bit tedious to copy schema definitions to

[web2py] New web2pyslices packages content

2013-07-30 Thread Alan Etkin
We have a new feature at web2pyslices.com to share information on public web2py projects. If you developed some web2py app, plugin, module, source code or tools in general that could be used with web2py, and you want to make it publicly available, you can simply add it to web2pyslices packages

[web2py] Form errors list ... Is there a way how to get field labels?

2013-07-30 Thread David Marko
I would like to disable inline form error messages and put these as a list above the form. Common errors list comtains the field name, which is rather technical term. Is there a way how to get a label name for each field name from form object? -- --- You received this message because you

[web2py] Re: Form errors list ... Is there a way how to get field labels?

2013-07-30 Thread Anthony
form.custom.label[fielname] Anthony On Tuesday, July 30, 2013 4:42:13 PM UTC-4, David Marko wrote: I would like to disable inline form error messages and put these as a list above the form. Common errors list comtains the field name, which is rather technical term. Is there a way how to

[web2py] Re: Form errors list ... Is there a way how to get field labels?

2013-07-30 Thread Anthony
Or db.mytable[fieldname].label On Tuesday, July 30, 2013 4:45:35 PM UTC-4, Anthony wrote: form.custom.label[fielname] Anthony On Tuesday, July 30, 2013 4:42:13 PM UTC-4, David Marko wrote: I would like to disable inline form error messages and put these as a list above the form.

[web2py] Re: New web2pyslices packages content

2013-07-30 Thread Anthony
Nice. A few comments: - At the very bottom of the form, there is a heading that says Right Sidebar. - In the actual right sidebar, there is an additional License dropdown -- presumably this is left over from the recipe/article post types, but seems a bit odd and confusing here

[web2py] Re: python 3.3.2

2013-07-30 Thread D Dan
Thanks Alan. Could you give an example how to share db.py and other function under models/ folder (say menu.py) across applications? On Tuesday, July 30, 2013 12:16:17 PM UTC-7, Alan Etkin wrote: You can share the schema across different apps by serving and requesting it in json or yaml

[web2py] Re: need help testing app

2013-07-30 Thread greaneym
I fixed some database problems and added more error checking and this seems to work fine now. Thanks for the help and tests. Margaret -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving

[web2py] Re: New web2pyslices packages content

2013-07-30 Thread Alan Etkin
- At the very bottom of the form, there is a heading that says Right Sidebar. Oops. I will remove it. - In the actual right sidebar, there is an additional License dropdown -- presumably this is left over from the recipe/article post types, but seems a bit odd and

[web2py] Re: bootstrap 3

2013-07-30 Thread samuel bonilla
graet i like use http://getbootstrap.com and http://foundation.zurb.com/ on web2py El lunes, 29 de julio de 2013 09:01:47 UTC-5, Niphlod escribió: just to inform everybody that 3.0 is coming out http://twitter.github.io/bootstrap/ -- --- You received this message because you are

[web2py] Re: New web2pyslices packages content

2013-07-30 Thread Anthony
I think we have to keep both licenses, one for the project and the normal document licence, because the user might want to add some stuff like extra documentation on the project or examples. Maybe I can add a note somewhere in the form to note the differences and also change the bare

[web2py] Access web2py app running on a remote server's localhost

2013-07-30 Thread Curiouslearn
Hello, I have a droplet on digitalocean running Ubuntu precise. I installed web2py using the source and then I started the server using python web2py.py command. The message says please visit: http://127.0.0.1:8000. Is there a way I can access from my local computer. Thank you. -- --- You

[web2py] Re: Web2Py + TurnkeyLinux and Apache

2013-07-30 Thread james c.
Let me clarify the situation. I am using the TKL Web2Py Appliance and deploying my Web2Py application through the TKL Hub. My application is myapp. I log in to the TKL Hub with SSL (this works just fine). I access the page for my applications server via SSL:

[web2py] Re: python 3.3.2

2013-07-30 Thread Alan Etkin
El martes, 30 de julio de 2013 18:19:15 UTC-3, D Dan escribió: Thanks Alan. Could you give an example how to share db.py and other function under models/ folder (say menu.py) across applications? If you will share models stored in modules, I suppose you can try something similar to what

[web2py] Re: Problem with virtual field

2013-07-30 Thread Joe Barnhart
I just ran into this one. It turns out that the row you want may be inside the row variable passed, with the table name as its key. How does this happen? If you have a select that has variables from several tables, for instance. I did come up with a workaround, but it's a little, uh...

Re: [web2py][share] Select2.js

2013-07-30 Thread Brian M
Nice find! On Tuesday, July 30, 2013 1:26:53 PM UTC-5, Richard wrote: Hello, I just found this (select2.js) : http://ivaynberg.github.io/select2/index.html A kind of chosen on steroïd... It include a Tagging utility that let insert new tag on the fly like Tag-it but don't seem to

[web2py] Accessing db from the module

2013-07-30 Thread Mark Finkelstein
I've been using current to access the db in my modules, but I would like to modularize my modules a bit so that I don't rely as much on current. I was wondering why db seems to not be accessible from the modules when passed by a caller and saved through the init statement. In other words, if I

[web2py] Re: I have some questions about Central Authorization Service (CAS)

2013-07-30 Thread Chun-Hung Chen
Hi, Thanks for the reply. Because I would like to integrate local account with social account, people can choose to login with social account or create an account on the website. That's the reason I think CAS is needed. Back to the issues, is it possible for me to pretest the login process