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
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
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
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
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__':
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 =
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
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'),
...
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
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
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
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.
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
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
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
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
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.
--
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
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
http://code.google.com/p/web2py/issues/detail?id=1007
--
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:
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
.
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
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'
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.,
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
Ok, I may try subclassing the validator and removing the translate calls
since I'm not doing and language translation.
Thanks,
Jim
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
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 *
Yeah, my version is a bit dated. I'll have a look at the newer stuff.
Thanks Anthony.
Ok, sounds good. I'll convert the code to use hidden argument explained in
Chapter 7. Thanks for the explanation, Anthony.
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,
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():
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:
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
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
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.
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
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',
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
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.
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?
Ah, I see. Ok, i'll give that some thought.
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
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?
Anyone?
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
([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
Done.
Issue 280: Virtual fields and with_alias error
behaviour?
Regards,
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
): 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
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
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
), dispute
settlements and arbitration, legal terms and software licences.
Is our approach acceptable? What have others done in the past?
Regards,
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
a freelancing service like vworker.com
(formerly rent-a-coder) or elance. Does anyone have any experience
with these companies?
Jim Karsten
. I'm not sure if this is a bug or not.
Any insight would be welcome.
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
similar to what I used above would improve that.
Regards,
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
61 matches
Mail list logo