[web2py] Re: web2py 2.17.1

2018-08-13 Thread Jim Karsten
ething? > > On Sunday, 12 August 2018 12:52:31 UTC-7, Jim Karsten wrote: >> >> I'm seeing a change in behaviour between versions 2.16.1 and 2.17.1. >> >> form = SQLFORM.factory(Field('name', writable=False)) >> print form.fields >> &g

[web2py] Re: web2py 2.17.1

2018-08-12 Thread Jim Karsten
I'm seeing a change in behaviour between versions 2.16.1 and 2.17.1. form = SQLFORM.factory(Field('name', writable=False)) print form.fields # In 2.16.1 prints: ['id', 'name'] # In 2.17.1 prints: ['id'] Is this intentional? -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Print statement fails in command line script (v2.15.3)

2017-08-30 Thread Jim Karsten
I'm using python version 2.7.12 On Tuesday, August 29, 2017 at 7:12:53 PM UTC-4, Dave S wrote: > > > > On Tuesday, August 29, 2017 at 1:33:53 PM UTC-7, Jim Karsten wrote: >> >> I run many scripts from the command line. After upgrading to v2.15.3, I >> find print st

[web2py] Re: Print statement fails in command line script (v2.15.3)

2017-08-30 Thread Jim Karsten
breaking > of backward compatibility, so feel free to report an issue on Github. > > Anthony > > On Tuesday, August 29, 2017 at 4:33:53 PM UTC-4, Jim Karsten wrote: >> >> I run many scripts from the command line. After upgrading to v2.15.3, I >> find print statements produce

[web2py] Print statement fails in command line script (v2.15.3)

2017-08-29 Thread Jim Karsten
I run many scripts from the command line. After upgrading to v2.15.3, I find print statements produce a SyntaxError. If I convert the statements to a print function it works. This was not a problem in v2.14.6. To illustrate: $ cat test.py #!/usr/bin/env python if __name__ == '__main__':

[web2py] Re: Grid links in component do not open in new window properly

2014-11-14 Thread Jim Karsten
I think I can make this work. Thanks for your help Anthony and Leonel. Jim On Thursday, November 13, 2014 9:33:04 AM UTC-5, Anthony wrote: A simpler option might be to check whether the request is being made via Ajax, and conditionally change the view: def inner(): response.view =

[web2py] Re: Bug? request.vars not set by routes_in query string.

2014-09-26 Thread Jim Karsten
Ticket opened: http://code.google.com/p/web2py/issues/detail?id=1990 On Friday, September 26, 2014 10:48:13 AM UTC-4, Massimo Di Pierro wrote: bug. please open a ticket so we track it and fix it. On Thursday, 25 September 2014 16:45:19 UTC-5, Jim Karsten wrote: I am setting a query string

[web2py] Bug? request.vars not set by routes_in query string.

2014-09-25 Thread Jim Karsten
I am setting a query string in routes_in but the request.vars is not getting set. To replicate: In routes.py routes_in = ( (BASE + '/$anything', '/welcome/default/index?aaa=111bbb=222'), ...

[web2py] Re: how to use gluon Expose

2014-06-26 Thread Jim Karsten
I was experimenting with Expose this week and I came across similar problems. For example, if I click on a subfolder link, the page refreshes but still displays the contents of the base folder. After some digging, I think I found the problem. The code in Expose uses request.raw_args to

[web2py] Re: Grid in component edit twice issue

2014-02-12 Thread Jim Karsten
Anyone have any ideas? Is it possible somehow to force an ajax reload of the grid after the edit form is submitted? -- 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

[web2py] Re: Grid in component edit twice issue

2014-02-05 Thread Jim Karsten
the component is reloaded to display the grid after the form is submitted. On Tuesday, February 4, 2014 10:07:23 AM UTC-5, Niphlod wrote: are you using exactly the app you packed ? On Tuesday, February 4, 2014 2:53:41 AM UTC+1, Jim Karsten wrote: Originally the *Edit* button has this code

[web2py] Grid in component edit twice issue

2014-01-15 Thread Jim Karsten
I have a grid inside a component. When I click the 'Edit' button on a row, submit the Edit form, then click the 'Edit' button a second time, the page reloads with only the component. Controllers: def index(): Container controller. return dict() def people(): Grid controller.

[web2py] Re: web2py 2.7.4 is OUT

2013-10-15 Thread Jim Karsten
I am having conditional model sorting problems. The issue is discussed here https://groups.google.com/forum/#!topic/web2py-developers/uE4-EwSo4_Q It appears a fix was put into place but only affected compiled apps. My app is not compiled. I have the following models. models/0.py

[web2py] Re: web2py 2.7.4 is OUT

2013-10-15 Thread Jim Karsten
I am having conditional model sorting problems. The issue is discussed here https://groups.google.com/forum/#!topic/web2py-developers/uE4-EwSo4_Q It appears a fix was put into place but only affected compiled apps. My app is not compiled. I have the following models. models/0.py

[web2py] Ver 2.3.2 changes the order models are loaded.

2012-12-20 Thread Jim Karsten
I have database tables defined in models/db.py. I have a controller-specific model defined in a models/client subdirectory. Ver 2.3.2 loads the models in a different order from ver 2.2.1. Ver 2.2.1 models/0.py models/db.py models/clients/edit/db.py Ver 2.3.2 models/0.py

[web2py] Re: Ver 2.3.2 changes the order models are loaded.

2012-12-20 Thread Jim Karsten
Sounds good. Thanks guys On Thursday, December 20, 2012 1:12:20 PM UTC-5, Jim Karsten wrote: I have database tables defined in models/db.py. I have a controller-specific model defined in a models/client subdirectory. Ver 2.3.2 loads the models in a different order from ver 2.2.1. Ver

[web2py] sessions2trash.py not working in v2.2.1, fix included

2012-10-24 Thread Jim Karsten
current.response._dbtable_and_field is referenced in sessions2trash.py. That value was replaced in version 2.2.1 with current.response.session_db_table, current.response.session_db_record_id, and current.response.session_db_unique_key. Attached is a fixed version of sessions2trash.py. --

[web2py] Re: Custom import creates module name conflicts (2.1.1)

2012-10-22 Thread Jim Karsten
as it can produce these clash problems and there is little I can do to prepare for them or protect my code from them. On Friday, October 19, 2012 7:37:44 PM UTC-4, Massimo Di Pierro wrote: Good catch. Fixed in trunk On Friday, 19 October 2012 16:54:54 UTC-5, Jim Karsten wrote: I upgraded to v

[web2py] Custom import creates module name conflicts (2.1.1)

2012-10-19 Thread Jim Karsten
I upgraded to v 2.1.1 and now see problems with module name conflicts due to the custom importer. Previously I used v2.0.9 without problems. I have a custom application module named utils.py. This appears to conflict with the gluon.utils module. I was able to simulate using the basic web2py

[web2py] Re: MySQLdb prints warnings to stdout

2012-09-17 Thread Jim Karsten
http://code.google.com/p/web2py/issues/detail?id=1007 --

[web2py] MySQLdb prints warnings to stdout

2012-09-14 Thread Jim Karsten
I use MySQL and after upgrading to 2.0.x I see MySQL warnings from time to time printed to stdout. It appears they originate from MySQLdb. Here is a simple example of how to produce the warnings. db.executesql('DROP TABLE IF EXISTS non_existent_table') /path/to/2.0.8/web2py/gluon/dal.py:1653:

[web2py] SQLFORM formstyle argument changes

2012-09-10 Thread Jim Karsten
The *SQLFORM formstyle* argument can change from a string to a function. For example: sqlform = SQLFORM(db.mytable, formstyle='table3cols') Now (sqlform.formstyle == 'table3cols') returns *False*. *sqlform.formstyle*is now a function named *formstyle_table3cols*. I haven't had any problems

[web2py] Re: hideerror in widget not working

2012-08-26 Thread Jim Karsten
. Anthony On Friday, August 24, 2012 3:30:02 PM UTC-4, Jim Karsten wrote: I created a custom widget including an *INPUT* with a *hideerror=True*parameter. It did not hide error messages. To simulate: in model: class SimpleWidget(FormWidget

[web2py] hideerror in widget not working

2012-08-24 Thread Jim Karsten
I created a custom widget including an *INPUT* with a *hideerror=True*parameter. It did not hide error messages. To simulate: in model: class SimpleWidget(FormWidget): _class = 'string'

[web2py] Re: Forms in multiple windows

2012-06-05 Thread Jim Karsten
On Monday, June 4, 2012 4:36:34 PM UTC-4, Anthony wrote: Massimo pointed out a flaw in my solution in that it would create an ever-growing number of session variables and would be vulnerable to a DoS attack. Maybe by default it could cycle through a small number of formnames (e.g.,

[web2py] Forms in multiple windows

2012-06-04 Thread Jim Karsten
Could we get a discussion going about web2py handling forms in multiple windows? A form may not submit as expected if a second window or tab is opened with the same form. Here are steps to reproduce the issue. 1. Create a page with a form. The form can be created by Crud or SQLFORM. 2. Open the

[web2py] Re: Link in a validator error message.

2012-05-28 Thread Jim Karsten
Ok, I may try subclassing the validator and removing the translate calls since I'm not doing and language translation. Thanks, Jim

[web2py] Link in a validator error message.

2012-05-24 Thread Jim Karsten
I would like to include a link in a validator error_message. The translate() function converts the link such that the raw HTML gets displayed instead. Anyone have any suggestions for how to get around this problem? Jim Karsten

[web2py] Component reshows validation messages.

2012-01-23 Thread Jim Karsten
If a page has a component, the validation error messages may display a second time. In web2py_ajax.html the function web2py_ajax_init() gets called twice, first when the main page loads called by *jQuery(document).ready(function() {});* and second when the component loads, called by function *

[web2py] Re: Component reshows validation messages.

2012-01-23 Thread Jim Karsten
Yeah, my version is a bit dated. I'll have a look at the newer stuff. Thanks Anthony.

[web2py] Re: web2py 1.99.3 is OUT

2011-12-13 Thread Jim Karsten
Ok, sounds good. I'll convert the code to use hidden argument explained in Chapter 7. Thanks for the explanation, Anthony.

[web2py] Re: web2py 1.99.3 is OUT

2011-12-12 Thread Jim Karsten
SQLFORM.factory hidden fields are not working the same in 1.99.3 as in 1.99.2. Here is a simple example form = SQLFORM.factory( Field('text_field'), Field('hidden_field', type='hidden', default='test'),) The hidden field is not hidden. Here is the html produced. The first is from 1.99.2,

[web2py] Re: 1.99 gluon/tools.py replace_id mishandling url [SOLVED]

2011-09-28 Thread Jim Karsten
I found a work around. I had two decorators on the index controller functions. I separated that function into two putting a decorator on each. Previously: @requires_session_option @auth.requires_login def index(): return dict() Now: @auth.requires_login def index():

[web2py] 1.99 gluon/tools.py replace_id mishandling url

2011-09-27 Thread Jim Karsten
Since upgrading to 1.99 (I tried both 1.99.1 and 1.99.2) I get this error: File /srv/http/myapp.com/web2py/gluon/tools.py, line 79, in replace_id return url % form.vars TypeError: float argument required, not Storage The value of url is:

Re: [web2py] JqGrid module

2011-08-05 Thread Jim Karsten
Johann, I updated the jqgrid application to include demos for using complex queries and accessing data from a webservice. Demos are found in the default.py controller. If you cloned the git repo, just run 'git pull' in the repo directory and you should get the latest. Cheers, Jim

[web2py] Re: jqgrid widget with no table source

2011-08-05 Thread Jim Karsten
xenebros, I updated the jqgrid application avaliable on the web2pyslice page to include a demo for accessing data from a webservice. Demos are found in the default.py controller. Cheers, Jim

[web2py] Re: jqgrid widget with no table source

2011-08-03 Thread Jim Karsten
I am working on a jqgrid module. There is a chance it can work for what you are trying to do. The module is designed around web2py tables but the JqGrid class can be subclassed and the data method, the method used to access the data for the jqgrid rows can be overridden with whatever you like.

[web2py] JqGrid module

2011-07-30 Thread Jim Karsten
Ray Luo and I are developing a web2py jqgrid module that allows you to insert a jqgrid into a page with only a few lines of code. # In model

[web2py] Re: Two fields with autocomplete in a single form fail

2011-07-21 Thread Jim Karsten
This was posted awhile ago but in case anyone else runs into this, the problem is the cities and categories fields have both the same name 'name'. The AutocompleteWidget *keyword* property gets set to the same value. The solution is to provide distinct *keyword* arguments. Field('city',

[web2py] Reponse.flash clobbers session.flash

2011-07-09 Thread Jim Karsten
When controller2 is called it redirects to controller1. The session.flash message is lost. Any suggestions for how to prevent the response.flash from clobbering the session.flash? def controller1(): form = SQLFORM.factory(Field('myfield')) if

Re: [web2py] Reponse.flash clobbers session.flash

2011-07-09 Thread Jim Karsten
Yeah, I'm aware of that. However, what if I want that message when controller1 is called on its own, not as a redirect from controller2. In the example I provided the message isn't very useful, but in some case the message can be.

Re: [web2py] Reponse.flash clobbers session.flash

2011-07-09 Thread Jim Karsten
You could check whether there's something in response.flash and not clobber it, if you liked. Do this in a models file, for example?

Re: [web2py] Reponse.flash clobbers session.flash

2011-07-09 Thread Jim Karsten
Ah, I see. Ok, i'll give that some thought.

[web2py] Re: Import from another application in 1.96.x

2011-06-15 Thread Jim Karsten
I understand what your saying and I do use that approach at times but I don't think it is ideal for what I'm looking at. Maybe I should explain further. While developing an application I might create a module in the applications modules directory. Then working on another application I see a

[web2py] Re: Import from another application in 1.96.x

2011-06-14 Thread Jim Karsten
Ok, that might work. Since many controllers make use of the other application, I'd rather not have to add the 'sys.path.append' line in each. I was thinking of adding it to a model file. Is that reasonable or would you recommend a better location?

[web2py] Re: Import from another application in 1.96.x

2011-06-13 Thread Jim Karsten
Anyone?

[web2py] Import from another application in 1.96.x

2011-06-10 Thread Jim Karsten
In a controller of one application I import classes from a module in another application using either of these syntaxes. from applications.another_app.modules.mymodule import MyClass MyClass = local_import('mymodule', app='another_app').MyClass Is there a better way to do that with the

[web2py] Validator: one of several fields must be non-empty

2011-06-09 Thread Jim Karsten
([request.vars.organization], error_message='Enter a name or an organization'), ), Field('organization', 'string', requires=IS_NOT_ALL_EMPTY([request.vars.name], error_message='Enter a name or an organization'), )) Cheers, Jim Karsten

[web2py] Re: Virtual fields and with_alias error

2011-05-26 Thread Jim Karsten
Done. Issue 280: Virtual fields and with_alias error

[web2py] Virtual fields and with_alias error

2011-05-25 Thread Jim Karsten
behaviour? Regards, Jim Karsten

[web2py] Re: Insert blank record crashes in sqlite

2011-05-12 Thread Jim Karsten
Here are two possible solutions, both for gluon.dal.py: class BaseAdapter(ConnectionPool): def insert(self,table,fields): if not fields: raise SyntaxError, 'No fields to insert' query = self._insert(table,fields) ... return rid or class SQLiteAdapter(BaseAdapter): def

[web2py] Insert blank record crashes in sqlite

2011-05-11 Thread Jim Karsten
): syntax error Not sure if this is a bug or not. Some dal methods produce an syntax error if no fields are provided. db(db.mytable.id == 1).update() SyntaxError: No fields to update Should insert() without fields be a syntax error? Regards, Jim Karsten

[web2py] sessions2trash.py improved

2011-05-06 Thread Jim Karsten
comments. This script works with session files only. Everyone is welcome to it. Regards Jim Karsten #!/usr/bin/env python # -*- coding: utf-8 -*- sessions2trash.py Run this script in a web2py environment shell e.g. python web2py.py -S app If models are loaded (-M option) auth.settings.expiration

[web2py] Re: Confusion using experts4solutions

2011-05-02 Thread Jim Karsten
Just to clarify, I posted on the freelance sites not to get coders competing for jobs, but to make use of their tools. I have lots of work and a healthy budget and I'm looking for a web2py professional. The job postings were intended to be just a stepping stone. Jim Karsten

[web2py] Confusion using experts4solutions

2011-04-27 Thread Jim Karsten
), dispute settlements and arbitration, legal terms and software licences. Is our approach acceptable? What have others done in the past? Regards, Jim Karsten

[web2py] web2py and freelancing services

2011-04-21 Thread Jim Karsten
We are looking for experienced developers to work on a web2py project. We are considering using a freelancing service like vworker.com (formerly rent-a-coder) or elance. Does anyone have any experience with these companies? Jim Karsten

[web2py] Re: web2py and freelancing services

2011-04-21 Thread Jim Karsten
a freelancing service like vworker.com (formerly rent-a-coder) or elance. Does anyone have any experience with these companies? Jim Karsten

[web2py] Puzzling registered trademark symbol appearance

2011-03-29 Thread Jim Karsten
. I'm not sure if this is a bug or not. Any insight would be welcome. Jim Karsten

[web2py] ISNULL for sorting NULLs to bottom

2011-03-29 Thread Jim Karsten
I would like to sort records on a field such that NULL values get sorted to the end. In MySQL the suggested solution is to use ISNULL. For example SELECT name FROM person ORDER BY ISNULL(name), name; I tried other approaches such as sorting the rows returned from a select but they were not

[web2py] Log tickets

2011-02-01 Thread Jim Karsten
similar to what I used above would improve that. Regards, Jim Karsten

[web2py] Possible typo in book

2010-12-21 Thread Jim Karsten
In web2py book, chapter 7 Forms and Validators, IS_IN_SET section, second paragraph, should this line: If you do not want a choose one option, set zero=False be: If you do not want a choose one option, set zero=None Jim Karsten