[web2py] Re: objet from view to controller using json

2013-01-14 Thread yn yn
Hi Alan thanks for the answer... Yes using $.post I can send a data Json string to the server. And also using reques.vars.data I can recover that string inside the jsontest. In order to check the transmision of data is correct, it is possible to save that string in the myfile.txt. For the

[web2py] Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Daniel Gonzalez
Hi, I have a problem with an import in my model: Traceback (most recent call last): File /installdir/web2py/gluon/restricted.py, line 212, in restricted exec ccode in environment File /installdir/web2py/applications/wavilon_portal/models/db.py, line 10, in module import nltk.data

[web2py] Re: objet from view to controller using json

2013-01-14 Thread Alan Etkin
but how do I do to transform the reques.vars.data to a object again. I would like to use it. With trunk, you can do: from serializers import loads_json loads_json(request.vars.data) # convert to Python object {value1: value1value!, ... } Otherwise from gluon.contrib import simplejson

[web2py] Re: wiki now partially documented

2013-01-14 Thread Alan Etkin
performancecomposites.co.nz I like the site, but, where's the auth.wiki feature used (in which action)? --

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Kostas M
I still have problems with the SQLFORM.smartgrid callbacks. I don't understand what is the correct usage of these functions. There are many different conflicting examples in the wiki. I define my ondelete callback: ondelete=dict( samples=my_sample_delete ) and I define the function: def

[web2py] local variable 'temp1' referenced before assignment ?

2013-01-14 Thread António Ramos
Hello, i need help i get error filedata=cStringIO.StringIO(temp1.read()) UnboundLocalError: local variable 'temp1' referenced before assignment but i dont see why? My controller def index(): image_form = FORM( INPUT(_name='image_title',_type='text'), INPUT(_name='image_url',_type='text')

[web2py] Re: Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Alan Etkin
I have a problem with an import in my model: What version are you running?, in what OS?. As a temporary workaround and If it's a path error you can try fixing sys.path so nltk is found. --

Re: [web2py] Re: SQLFORM.grid with reference

2013-01-14 Thread __pyslan__ - Ayslan Jenken
Hello, Massimo. I did what you asked me to. Follow the issue: 1274http://code.google.com/p/web2py/issues/detail?id=1274sort=-id Thanks!! On Sun, Jan 13, 2013 at 1:54 PM, __pyslan__ - Ayslan Jenken ayslan.pyt...@gmail.com wrote: Ok. Thanks! On Fri, Jan 11, 2013 at 7:39 PM, Massimo Di

[web2py] Re: Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Daniel Gonzalez
Version 2.3.2 (2012-12-17 08:59:58) stable, commit 9557c46, in Ubuntu 12.04.1 LTS. I am running from a virtualenv with python 2.7.2. I have no idea how to force nltk to be found: the sys.path is correct, as I have verified by setting manually in the interpreter and running the import

[web2py] Re: Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Daniel Gonzalez
The problem is this code in custom_import.py # if not relative and not from applications: if hasattr(current, 'request') \ and level = 0 \ and not name.split('.')[0] in INVALID_MODULES \ and isinstance(globals, dict): import nltk.data goes through, but

[web2py] Strange behavior storing data - web2py 2.3.2 - Mac OS X 10.7.5

2013-01-14 Thread Luciano Laporta Podazza
Hello, I've been experimenting a really annoying issue that came up from nowhere 'cause the app was working perfectly. This is the scenario: A mobile app user(iOS) enter his credentials on Facebook and gets the corresponding auth token and personal data(JSON). The mobile app sends for the

[web2py] Re: Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Alan Etkin
The problem is this code in custom_import.py With a very similar configuration but the trunk version I could not reproduce the problem (altough the nltk library has taken about 20 seconds to import in the model) My system config: Python 2.7.3 Ubuntu 12.04 Rocket server This has something

[web2py] Re: parse_as_rest queries

2013-01-14 Thread DenesL
Thank you. On Sunday, January 13, 2013 11:52:19 PM UTC-5, Massimo Di Pierro wrote: web2py uses b64encode/decode to store/retrieve data in blobs. Legacy tables probably do not do it. You need you make your own custom adapter to override a method. For example for PostgreSQL: from

[web2py] Re: Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Daniel Gonzalez
I have logged the import activity, modifying custom_import like this: FORMAT=%s - %-40s %-10s %-10s %-10s %-10s # if not relative and not from applications: if hasattr(current, 'request') \ and level = 0 \ and not name.split('.')[0] in INVALID_MODULES \

[web2py] Re: Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Daniel Gonzalez
I have found a workaround (hack) to my problem. I had to modify: INVALID_MODULES = set(('', 'gluon', 'applications', 'custom_import')) to INVALID_MODULES = set(('', 'gluon', 'applications', 'custom_import', 'nltk', 'collocations', 'numpy', 'testing')) (there were more modules affected by the

[web2py] Changes in jsonrpc calls?

2013-01-14 Thread Daniel Gonzalez
I am moving to a recent web2py version, and I realize that now the json parameters are parsed inside tools.serve_jsonrpc. Previously I was parsing them in my jsonrpc controller, so that means I have to adapt my controllers. Unexpected, but I can manage. My question is: Should I do

[web2py] Re: Looking for a web2py/mysql performance expert

2013-01-14 Thread Willoughby
Be sure to check http://experts4solutions.com/ I think that's where most web2py experts still reside... On Sunday, January 13, 2013 9:48:54 PM UTC-5, Furayo wrote: Hi, We are looking with somebody with experience in performance optimization and general administration on web2py mysql. This

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Kostas M
What I have found out about not firing at all is that in SQLFORM.smartgrid, ondelete and oncreate callbacks should not be dictionaries! Although the book says: All the arguments but the table, args, linked_table and user_signatures can be dictionaries ..'', and in my case e.g:

Re: [web2py] help with ckeditor?

2013-01-14 Thread Bruno Rocha
web2pyslices source code: https://github.com/rochacbruno/Movuca Ckeditor module https://github.com/rochacbruno/Movuca/blob/master/modules/plugin_ckeditor.py Ckeditor static files https://github.com/rochacbruno/Movuca/tree/master/static/plugin_ckeditor The plugin

[web2py] delete query translation

2013-01-14 Thread dederocks
Hello, How do you translate the following in dal? delete tableA from tableA where TableA.field1='x' join TableB on TableB.field2=TableA.field3 WHERE (TableB.field3 = y) ? if you do db((tableA.field1=='x') (tableA.field3==TableB.field2) (TableB.field3==y)).delete() it doesn't work -- too many

[web2py] Handling unicode keys in jsonrpc calls

2013-01-14 Thread Daniel Gonzalez
Recently web2py changed to parse the jsonrpc parameters in tools.py/Service.serve_jsonrpc. Now I have a frawework in my client (ember.js) which is sending unicode keys in the jsonrpc parameters. This causes the code to fail, like this: {version: 1.1, id: ID1, error: {message: TypeError:

[web2py] Re: Cannot change PasswordWidget class in view for custom auth form.

2013-01-14 Thread Anthony
The password widget is actually an INPUT helper wrapped in a CAT helper (which enables the new entropy validator Javascript to be appended if needed), so form.custom.widget.password actually refers to the outer CAT helper and form.custom.widget.password['_class'] is therefore the class of the

[web2py] DAL _after_delete vs _before_delete

2013-01-14 Thread Kostas M
According to the book, in the DAL chapter, subtitle: 'before and after callbacks', we can use: db.person._before_delete.append(lambda s: pprint(s)) db.person._after_delete.append(lambda s: pprint(s)) where: s is the Set object used for update or delete. However, def person_before_delete(s):

[web2py] Re: width

2013-01-14 Thread Saba
Any suggestions please? --

Re: [web2py] Re: width

2013-01-14 Thread António Ramos
i know that in form.smartgrid you can set the with of columns with a paramenter in form.smartgrid( maxtextlengths={10,20,etc} maxtextlength sets the maximum length of text to be displayed for each field value, in the grid view. This value can be overwritten for each field using

[web2py] Re: web2py, stripe, and pci compliance

2013-01-14 Thread howesc
i did some reading on PCI compliance and it's a quagmire! There are multiple levels of PCI requirements depending on what you do with the data. as best i can tell (without being an expert), a javascript only solution that posts directly to swipe and one where you post data to your server and

[web2py] Re: delete query translation

2013-01-14 Thread Ron McOuat
Change the == on the field tests to single = db((tableA.field1='x') (tableA.field3==TableB.field2) (TableB.field3=y)).delete() Ron if you do db((tableA.field1=='x') (tableA.field3==TableB.field2) (TableB.field3==y)).delete() it doesn't work -- too many tables selected. I also tried

[web2py] How to Truncate a Post or display post exceprts

2013-01-14 Thread ola . dipo30
I am new to web2py and was wondering how I can go about displaying a post excerpts on a page. e.g. {{=WIKI(post.body|truncate:30)}} or something similar to that? Thanks in advance. {{ for post in posts:}} h2 a href={{=URL(r=request,f='view_post',args=post.id)}} {{=post.title}}

[web2py] SQLFORM.smartgrid create callback

2013-01-14 Thread Kostas M
I have a hard time with these grid/smartgrid callbacks. Now regarding the 'create' option: If I put grid = SQLFORM.smartgrid(db.mytable, ,create=False), then correctly, the '+Add' button doesn't appear on the web application. But if I put a lambda callback there: grid =

[web2py] How to accomplish post excerpt

2013-01-14 Thread ola . dipo30
{{ for post in posts:}} h2 a href={{=URL(r=request,f='view_post',args=post.id)}} {{=post.title}} /a /h2 {{=WIKI(post.body|truncate:30)}} {{pass}} Thanks in avance. something similar to Django |truncate:x --

[web2py] Re: How to accomplish post excerpt

2013-01-14 Thread Niphlod
if post.body is a string, you can do post.body[:30] like you would do with a normal python string. You can't get fancy with a post.body[:27] + '...' just for the sake of being polite. The problem in your code is that you're truncating a source of something that needs to be truncated at the

[web2py] Re: How to Truncate a Post or display post exceprts

2013-01-14 Thread Niphlod
duplicate of https://groups.google.com/d/topic/web2py/aONcRDTWE40/discussion On Monday, January 14, 2013 4:46:44 PM UTC+1, ola.d...@gmail.com wrote: I am new to web2py and was wondering how I can go about displaying a post excerpts on a page. e.g. {{=WIKI(post.body|truncate:30)}} or something

Re: [web2py] Re: scheduler error message

2013-01-14 Thread Niphlod
? On Sunday, January 13, 2013 9:37:38 PM UTC+1, mweissen wrote: Solved. I have tried to use request.env.server_name in db.py 2013/1/13 Martin Weissenboeck mwei...@gmail.com javascript: Now I have tried to reduce this problem: There is only one function in myscheduler: myscheduler =

[web2py] Re: How to accomplish post excerpt

2013-01-14 Thread ola . dipo30
Thanks for the quick response. quite helpful. On Monday, January 14, 2013 10:52:49 AM UTC-6, ola.d...@gmail.com wrote: {{ for post in posts:}} h2 a href={{=URL(r=request,f='view_post',args=post.id)}} {{=post.title}} /a /h2 {{=WIKI(post.body|truncate:30)}} {{pass}}

Re: [web2py] Re: Hierarchical Database Selection

2013-01-14 Thread Niphlod
On Sunday, January 13, 2013 8:51:55 PM UTC+1, Vasile Ermicioi wrote: That way you can issue queries like db.trains.company == 'amtrack' that are - usually - faster than filtering records through joins. you can't do db.trains.company == 'amtrack' because company is a reference field

Re: [web2py] Re: scheduler error message

2013-01-14 Thread Martin Weissenboeck
I have found: In db.py I have something like sn = request.env.server_name If this line is called by the scheduler sn gets the value None 2013/1/14 Niphlod niph...@gmail.com ? On Sunday, January 13, 2013 9:37:38 PM UTC+1, mweissen wrote: Solved. I have tried to use

[web2py] dropping Janrain and migrating users to new login system?

2013-01-14 Thread Rick Ree
Hi, I'm developing an application that currently uses Janrain for authentication. I'm running an instance of the app that has a dozen users or so. I would like to redesign the app so that it can be installed by end users without requiring signing up with Janrain. So, I'm thinking of switching

[web2py] Re: Burned by web2py.js ... again

2013-01-14 Thread Massimo Di Pierro
What did you upgrade from? What specifically changed that broke your code? When you upgrade web2py we do not upgrade web2py.js in your applications. The fact that form uploads is second citizen is not a web2py issue. It is an Ajax issues. Ajax does not support multipart forms. I am not award

[web2py] Re: TypeError: __call__() takes exactly 3 arguments (4 given)

2013-01-14 Thread Massimo Di Pierro
Very odd. Can you try replace thread.start_new_thread(start_browser, (get_url(ip, proto=proto, port=port),), dict(startup=True)) with thread.start_new_thread(start_browser, (get_url(ip,

[web2py] Re: Strange behavior storing data - web2py 2.3.2 - Mac OS X 10.7.5

2013-01-14 Thread Massimo Di Pierro
You say This was actually working and I didn't modified anything(really). did you upgrade or did it simply stopped working? On Monday, 14 January 2013 05:19:05 UTC-6, Luciano Laporta Podazza wrote: Hello, I've been experimenting a really annoying issue that came up from nowhere 'cause the

[web2py] Re: DAL _after_delete vs _before_delete

2013-01-14 Thread Derek
That's the way to do it. Although I'd use a session variable instead of global. If you are using global, you are bound to have some race conditions. On Monday, January 14, 2013 8:20:16 AM UTC-7, Kostas M wrote: According to the book, in the DAL chapter, subtitle: 'before and after

[web2py] Re: Strange import problem: is sys.path not used in web2py?

2013-01-14 Thread Massimo Di Pierro
I do not know why that is. For now you can also do: from gluon.custom_import import INVALID_MODULES for key in ('nltk', 'collocations', 'numpy', 'testing'): INVALID_MODULES.add(key) On Monday, 14 January 2013 06:12:47 UTC-6, Daniel Gonzalez wrote: I have found a workaround (hack) to my

[web2py] Re: delete query translation

2013-01-14 Thread Massimo Di Pierro
It should. Please open a ticket and we will add it. On Monday, 14 January 2013 07:34:51 UTC-6, dederocks wrote: Hello, How do you translate the following in dal? delete tableA from tableA where TableA.field1='x' join TableB on TableB.field2=TableA.field3 WHERE (TableB.field3 = y) ? if

[web2py] Re: DAL _after_delete vs _before_delete

2013-01-14 Thread Massimo Di Pierro
It is. after_delete is executed after delete therefore the record is no longer there to be selected. On Monday, 14 January 2013 09:20:16 UTC-6, Kostas M wrote: According to the book, in the DAL chapter, subtitle: 'before and after callbacks', we can use:

[web2py] Re: web2py, stripe, and pci compliance

2013-01-14 Thread Massimo Di Pierro
I studied the PCI specs when I taught a security class years ago. Things may have changed. I too remember that the major issue with PCI compliance was securing the server (keeping everything updated, applying security patches, running latest antivirus and intrusion detection software) and

[web2py] Re: SQLFORM.smartgrid create callback

2013-01-14 Thread Massimo Di Pierro
create is not a callback. It checks for true/false. A lambda is true. On Monday, 14 January 2013 10:46:07 UTC-6, Kostas M wrote: I have a hard time with these grid/smartgrid callbacks. Now regarding the 'create' option: If I put grid = SQLFORM.smartgrid(db.mytable, ,create=False), then

[web2py] Re: dropping Janrain and migrating users to new login system?

2013-01-14 Thread Massimo Di Pierro
I think you can do it with this: gluon/contrib/login_methods/extended_login_form.py but I did not try it. Look in the file for examples. On Monday, 14 January 2013 11:22:25 UTC-6, Rick Ree wrote: Hi, I'm developing an application that currently uses Janrain for authentication. I'm running

[web2py] Re: web2py, stripe, and pci compliance

2013-01-14 Thread Derek
If your application handles credit card information, it must be audited for compliance. So it may or may not be compliant, an audit will determine that. What most companies do is avoid the audit by not handling credit card information. If you use authorize.net (as an example) you can use the

[web2py] Re: web2py, stripe, and pci compliance

2013-01-14 Thread Derek
Also note for stripe... https://stripe.com/us/help/faq#pci-compliance Anyone accepting credit card payments must be PCI compliant—but with Stripe, it's easy: - Serve your payment page over SSL https://stripe.com/help/ssl, i.e., the page's web address should begin with https, not

Re: [web2py] Strange behavior storing data - web2py 2.3.2 - Mac OS X 10.7.5

2013-01-14 Thread Luciano Laporta Podazza
On Jan 14, 2013, at 2:45 PM, Massimo Di Pierro wrote: You say This was actually working and I didn't modified anything(really). did you upgrade or did it simply stopped working? It simply stopped working. On Monday, 14 January 2013 05:19:05 UTC-6, Luciano Laporta Podazza wrote: Hello,

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Derek
What book are you looking at? I can't find that phrase anywhere in the book. On Monday, January 14, 2013 6:09:22 AM UTC-7, Kostas M wrote: What I have found out about not firing at all is that in SQLFORM.smartgrid, ondelete and oncreate callbacks should not be dictionaries! Although the

[web2py] Re: wiki now partially documented

2013-01-14 Thread Andrew W
Thanks default/index. The main page has a lot of tags like {{=auth.wiki('whatwedo')}} so that each subsection can be edited through the [Wiki] menu. The rest are straight one wiki page for each url. (except for Contact where I use a component. I would probably rejig the front page at some

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Kostas M
The exact phrasehttp://www.web2py.com/books/default/chapter/29/07?search=smartgrid#SQLFORM.grid-and-SQLFORM.smartgridis: All the arguments but the table, args, linked_tables and user_signatures can be dictionaries as explained below. What book are you looking at? I can't find that phrase

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Derek
You must have missed this part: The smartgrid takes the same arguments as a grid and some more with some caveats: On Monday, January 14, 2013 12:25:15 PM UTC-7, Kostas M wrote: The exact

[web2py] Grid with multiple left joins

2013-01-14 Thread Felipe Meirelles
Hi, When you try to make more than one left join on a SQLFORM.grid as: grid = SQLFORMCustom.grid(db.device, fields=[db.device.serial, db.device.device_type, db.device.vehicle, db.vehicle.plate, db.chip.imei, ], field_id=db.device.id,

[web2py] Re: Grid with multiple left joins

2013-01-14 Thread Felipe Meirelles
Please desconsider the sorter_icons parameter, its a custom implementation of mine. I can post this patch too if you think its relevant. Thanks! On Monday, January 14, 2013 5:38:53 PM UTC-2, Felipe Meirelles wrote: Hi, When you try to make more than one left join on a SQLFORM.grid as:

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Kostas M
Sorry, I don't understand what you mean. *ondelete* isn't supposed to take dictionaries in smartgrid, as editable and deletable do? On Monday, January 14, 2013 7:32:21 PM UTC, Derek wrote: You must have missed this part: The smartgrid takes the same arguments as a grid and some more with

Re: [web2py] Re: Hierarchical Database Selection

2013-01-14 Thread Derek
Yes, I'm all for de-normalizing when it makes sense to do so. There's no reason for this data to be normalized. I'm going to give the thread starter the benefit of the doubt and assume it's not actually about trains. On Monday, January 14, 2013 10:10:34 AM UTC-7, Niphlod wrote: On Sunday,

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Derek
ondelete is functionality provided by *grid* and not *smartgrid*. So the documentation for *grid* applies, not the documentation for *smartgrid*. On Monday, January 14, 2013 12:43:44 PM UTC-7, Kostas M wrote: Sorry, I don't understand what you mean. *ondelete* isn't supposed to take

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Alan Etkin
What I have found out about not firing at all is that in SQLFORM.smartgrid, ondelete and oncreate callbacks should not be dictionaries! Note that if you are declaring the callback function in a controller, you cannot use functions without arguments, since they are reserved for actions.

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Kostas M
Editable and deletable are functionalities also provided by *grid though*... On Monday, January 14, 2013 7:45:45 PM UTC, Derek wrote: ondelete is functionality provided by *grid* and not *smartgrid*. So the documentation for *grid* applies, not the documentation for *smartgrid*. --

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Niphlod
ok, let me put together an example and then we can find a better explanation for the docs.back in 10 minutes. On Monday, January 14, 2013 9:00:31 PM UTC+1, Kostas M wrote: Editable and deletable are functionalities also provided by *grid though* ... On Monday, January 14, 2013 7:45:45

[web2py] Re: SQLFORM.smartgrid create callback

2013-01-14 Thread Kostas M
Thanks for the clarification. In my case, I have two tables: db.define_table('analyses',Field('info'),Field('status') db.define_table('samples',db.analyses,Field('sample_info') and I use: grid=SQLFORM.smartgrid(db.analyses,linked_tables=['samples']) I want when the status of an Analysis is

[web2py] Re: parse_as_rest, many to many and multiple tables

2013-01-14 Thread pinwc4
Greeting DenesL, I appreciate you taking the time to respond. On Sunday, January 13, 2013 9:34:43 AM UTC-6, DenesL wrote: Hi pin, to the person, pet and toy tables add: format='%(name)s' Thanks for the suggestion, I generally do this in my other apps, just did not include it in the quick

[web2py] Re: Scheduler tasks stuck in ASSIGNED state

2013-01-14 Thread Adi
Seems like we have the same situation (Version 2.3.2 (2012-12-17 15:03:30) stable). More and more tasks are just being assigned, but not completed nor failed. I can send you a debug log via email, if this hasn't been fixed in trunk? Thanks, Adnan On Wednesday, December 19, 2012 2:46:07 PM

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Niphlod
A bit of code is better than a thousand words. Help us to improve the docs on your own words for the online book.. let's resume the plain old person - dog model. db.define_table('person', Field('name', requires=IS_NOT_EMPTY()) ,format = '%(name)s' ) db.define_table('dog',

Re: [web2py] Re: Scheduler tasks stuck in ASSIGNED state

2013-01-14 Thread Jim Kellas
theirgrrreat From: Adi adnan.smajlo...@gmail.com Reply-To: web2py@googlegroups.com Date: Monday, January 14, 2013 12:44 PM To: web2py@googlegroups.com Subject: [web2py] Re: Scheduler tasks stuck in ASSIGNED state Seems like we have the same situation (Version 2.3.2 (2012-12-17 15:03:30)

[web2py] Re: Burned by web2py.js ... again

2013-01-14 Thread Niphlod
the only problems I encountered are the changes of the encodings/escaping for web2py-component-command and web2py-component-flash headers had a little of problems rewriting semi-custom implementation for flash messages and component-reloading with all the escape/unescape/decodeURIComponent

[web2py] Re: help with ckeditor?

2013-01-14 Thread samuel bonilla
but, how can i add this in ckeditor ? El domingo, 13 de enero de 2013 16:21:18 UTC-5, samuel bonilla escribió: hi all, I am using the ckeditor plugin ( https://bitbucket.org/PhreeStyle/web2py_ckeditor/wiki/Home). I want add the tag code in ckeditor, to insert code how it works in

Re: [web2py] Re: scheduler error message

2013-01-14 Thread Niphlod
yep. Scheduler's function are called OUTSIDE the web2py process, like in a shell, so there is a fake request that doesn't hold ALL the keys of a normal request. Namely, request.env by default holds only Storage {'http_host': '127.0.0.1:8000', 'path_info': '/welcome/None/None',

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Alan Etkin
A bit of code is better than a thousand words. Help us to improve the docs on your own words for the online book.. There's need of documentation about onedelete arguments then (I didn't find it in the online book). I was confused because it reads (in the sqlform section): ... All but

[web2py] Re: Scheduler tasks stuck in ASSIGNED state

2013-01-14 Thread Niphlod
trunk got some patches with the help of Mike Dickun. However, the problem described in this thread was never reproduced by yours truly (:-P) both with 2.3.2 or the latest scheduler .. I'm always available if something is not working ok with the scheduler just send along the log and the

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Niphlod
@all: let's wrap up a patch for the docs in order to clear the doubts :-P On Monday, January 14, 2013 10:04:51 PM UTC+1, Alan Etkin wrote: A bit of code is better than a thousand words. Help us to improve the docs on your own words for the online book.. There's need of documentation

Re: [web2py] Re: scheduler error message

2013-01-14 Thread Martin Weissenboeck
Thank you, I understand now. The reason is: I have two web2py installations, one for develepment and one for production. If some part of the code works as expected I copy it from the development system to the production system and therefore I wanted to let the code know where it is. 2013/1/14

[web2py] Re: SQLFORM.smartgrid create callback

2013-01-14 Thread Niphlod
offtopicmantra for users seeking help post a working model, post a working model, post a working model/offtopic db.define_table('analyses', Field('info'), Field('status'), format='%(info)s') db.define_table('samples', Field('analyses_id', 'reference analyses'),

[web2py] Online book typo on static asset management

2013-01-14 Thread António Ramos
Please check cahnge word instead of change --

[web2py] Httponly for cookies/sessions

2013-01-14 Thread Mark Li
I haven't found anything in the web2py documentation about setting the httponly attribute for cookies and sessions. For sessions, there is session.secure() to set the session cookies to secure, is there a similiar method to setting the httponly option for session cookies? Also for regular

[web2py] Re: Httponly for cookies/sessions

2013-01-14 Thread Mark Li
On Monday, January 14, 2013 2:45:21 PM UTC-8, Mark Li wrote: I haven't found anything in the web2py documentation about setting the httponly attribute for cookies and sessions. For sessions, there is session.secure() to set the session cookies to secure, is there a similiar method to

[web2py] Re: SQLFORM.smartgrid create callback

2013-01-14 Thread Kostas M
Awesome! (and I will keep repeating the mantra in my mind =) ) --

Re: [web2py] Strange behavior storing data - web2py 2.3.2 - Mac OS X 10.7.5

2013-01-14 Thread Alan Etkin
except: return ivalid_token2 In order to be able to debug the error, I'd suggest to temporarily remove the try/except that encloses the new user insertion code, so you can access the error ticket created by web2py (with the actual error information raised by the graph library). --

Re: [web2py] Re: in-line select for counting purpose

2013-01-14 Thread vincent
Hi all, I have exactly the same problem and I want to know if somebody found a way to do in-line selects ? Im not really keen to use executeSql. Btw, does anybody know why when I .json my query results, aliases (made with .with_alias() are not used ? (sorry for this question not really linked

[web2py] Re: Burned by web2py.js ... again

2013-01-14 Thread Massimo Di Pierro
whehe claims this is the third time. We only changed the behavior of this once as far as I can remember. On Monday, January 14, 2013 2:57:08 PM UTC-6, Niphlod wrote: the only problems I encountered are the changes of the encodings/escaping for web2py-component-command and

Re: [web2py] Strange behavior storing data - web2py 2.3.2 - Mac OS X 10.7.5

2013-01-14 Thread Massimo Di Pierro
Also notice that f you do try: db.table.insert() except: return ivalid_token2 and indeed the try fails in the insert than you must db.rollback() in the except, else the database remains in an invalid state. On Monday, January 14, 2013 5:09:59 PM

[web2py] Re: Httponly for cookies/sessions

2013-01-14 Thread Anthony
For sessions, there is session.secure() to set the session cookies to secure, is there a similiar method to setting the httponly option for session cookies? No. Also for regular cookies, the following would make the cookie secure response.cookies['mycookie']['secure'] = True So

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Kostas M
Fantastic! And since we are on the topic, can we clarify also the use of dictionaries for the callbacks in the case of smartgrid? Which options can take a dict of functions, and which not? E.g. it seems ondelete can't take a dictionary, while editable can:

[web2py] Re: Httponly for cookies/sessions

2013-01-14 Thread Mark Li
Yep that did the trick, thanks Anthony! On Monday, January 14, 2013 2:45:21 PM UTC-8, Mark Li wrote: I haven't found anything in the web2py documentation about setting the httponly attribute for cookies and sessions. For sessions, there is session.secure() to set the session cookies to

Re: [web2py] Re: Httponly for cookies/sessions

2013-01-14 Thread Vasile Ermicioi
session.connect(cookie_key='your_key', compression_level=9) and after that session['a_key']='a_value' --

Re: [web2py] Re: SQLFORM.grid callbacks

2013-01-14 Thread Massimo Di Pierro
The rule is simple. All options that belong to both grid and smartgrid (except args) can take a dictionary in smartgrid. If a dictionary is passed, the value is passed the grid, in correspondance to a key == tablename. On Monday, 14 January 2013 17:50:58 UTC-6, Kostas M wrote: Fantastic!

[web2py] Re: parse_as_rest queries

2013-01-14 Thread DenesL
This also seems to work: db._adapter.parse_blob=lambda value,field_type: value Any cons?. --

[web2py] Cherokee setup

2013-01-14 Thread Richard Penman
I usually use nginx / uwsgi but just tried comparing the cherokee setup. The admin has changed quite a lot since the book was written. For running admin the web2py book has this: sudo nohup cherokee-admin However this will block displaying the admin login password, so need this instead: sudo

[web2py] Re: Cannot change PasswordWidget class in view for custom auth form.

2013-01-14 Thread Aris Green
Much appreciated, worked great. Thanks On Monday, January 14, 2013 7:34:25 AM UTC-7, Anthony wrote: The password widget is actually an INPUT helper wrapped in a CAT helper (which enables the new entropy validator Javascript to be appended if needed), so form.custom.widget.password actually

[web2py] Amazon RDS

2013-01-14 Thread Simon Ashley
Wondering if it is possible to connect an EC2 instance/ application to a RDS instance (MYSQL), and what the connection string should be? There is some discussions here implying that it may be possible but uncertain of the connection string. What's been suggested is db = DAL('mysql//*connection

[web2py] Re: parse_as_rest, many to many and multiple tables

2013-01-14 Thread DenesL
Hi pin, you are welcome. I just sent Massimo another patch, if it is included then: '/{ownership.personid}/pets[pet.id]' would work to get all pet table fields for those pets whose owner is personid. Trunk version 4613 already has support for *'*/pets/{ownership.personid}/toys[toy.owner]'

[web2py] Fatal Python error: Couldn't create autoTLSkey mapping

2013-01-14 Thread Richard Penman
hello, I set up a uwsgi / nginx server using the setup-web2py-nginx-uwsgi-ubuntu.sh script. However I find when the app tries to start a sub-process I get this error: Fatal Python error: Couldn't create autoTLSkey mapping I read around and apparently this can happen when lack of memory. Do