Just for the record, because it's not clear from this thread, the Python
3,8 problem seems to have been taken care of. I've been running web2py on
Python 3.8 for the last couple of weeks at least and never noticed a
problem.
On Sunday, January 3, 2021 at 2:26:52 PM UTC-6 jimka...@yahoo.com wr
And whatever "lucky food" you ate LAST year on New Year's -- DON'T TOUCH
THAT STUFF!! It didn't work.
-- Joe
On Thursday, December 31, 2020 at 4:33:09 PM UTC-6 snide...@gmail.com wrote:
> On Thursday, December 31, 2020 at 11:37:24 AM UTC-8 Massimo Di Pierro
> wrote:
>
>>
>> I wish you all a h
else:*
* rtn = None*
Does anyone know how to make code blocks in this new stupid Google Groups
window? Sheesh. One step sideways and three steps back.
-- Joe
On Wednesday, September 11, 2019 at 12:11:13 AM UTC-5 Massimo Di Pierro
wrote:
> :-)
>
>
> On Mo
Jose C wrote:
> I have it working with python3 but only as far as web2py 2.18.5.
> Thereafter I cannot get it to work either.
>
> Unfortunately it does begin to appear that web2py has reached end of life
> status.
>
> On Friday, 13 November 2020 at 03:13:18 UTC Joe Barn
I know this is really old news, but redis no longer works under python 3
and web2py. I'm just thinking it's time to take out all mention of redis
from the book and list of features of web2py. Yes, it technically works
with python 2, but since that platform is now dropped in the wake of the
go
I'm using LOAD functionality to break my webpage into bite-sized "cards" or
"widgets" each of which is loaded separately when the page is called. My
overall website looks much like a "dashboard" with several of these widgets
on a single page.
I'm trying to understand the LOAD process and how I
FWIW there's nothing stopping you from using peewee inside web2py instead
of DAL, if you desire. It's kind of an advanced topic, but it's possible.
I notice peewee relies on cascaded message sends. Being an old
Smalltalker I actually like cascaded message sends, but I recall that pypy
really
Doesn't this have an unfortunate negative effect on "compiled" views? To
be compiled, everything about the view needs to be known ahead of time and
your dynamic use of templates seems to defeat that. I suspect when you
choose to "compile" the application from the web2py admin interface, these
Having more than one group with the same permissions is no problem at all.
In fact, it's kind of the purpose of role-based authentication.
I have a web site that features different classes of users who need access
to pages. Some groups can access every single page in the site (e.g.
'root' use
Yep. I just confirmed the errant behavior with web2py 2.20.4 and python
3.8.2. If reds sessions are enabled the logon never completes.
-- Joe B.
On Sunday, March 29, 2020 at 11:39:10 PM UTC-5, Massimo Di Pierro wrote:
>
> Sorry. We should fix this. Will look into it asap.
>
> On Sunday, 29 Mar
PM UTC-7, Massimo Di Pierro wrote:
>
> py4web supports redis. Just saying. ;-)
>
> On Monday, 9 September 2019 09:27:20 UTC-7, Joe Barnhart wrote:
>>
>> I sure wish somebody could fix this. It's a real bottleneck to Python3
>> adoption for my site. I tried usi
o create a test bench for this.
If someone else has a Python2/redis site already they may be able to test
it quicker.
-- Joe
On Monday, September 9, 2019 at 3:00:50 PM UTC-7, Jim S wrote:
>
> Is it backward compatible as well?
>
> -Jim
>
> On Mon, Sep 9, 2019 at 4:54 PM Joe
my own applications) to work in a
> multinode environment accessing a distributed redis server for session
> caching.
> Let us know if it solves your problem.
> Regards
> Stephane
>
>
> Le lundi 9 septembre 2019 18:27:20 UTC+2, Joe Barnhart a écrit :
>>
>> I sur
s%7Csort:date/web2py/PdquGF_9a2E/6VJpLqsnBgAJ
>>
>> At that time I just continued using python redis 2.10.6. But, can't do
>> that forever. Anyone able to test or improve upon the change I made
>> above? Like I said, it works for me, but I don't know h
um/?pli=1#!searchin/web2py/redis%7Csort:date/web2py/PdquGF_9a2E/6VJpLqsnBgAJ
>
> At that time I just continued using python redis 2.10.6. But, can't do
> that forever. Anyone able to test or improve upon the change I made
> above? Like I said, it works for me, but I don't kn
Sorry for the delay in replying.
The first step is to create a Select object, rather than an Expression.
Look again at the code:
subq = db(dbts.id>0).nested_select(dbts.ALL,...etc)
This creates a Select object. The Select object implements "on". (Table
also implements "on", but not Expressio
Sorry I didn't see this question earlier.
The "on" attribute is on the Table object. If you look at the code, I use
variables like
dbt = db.times
This allows me to use "dbt.xxx" to access the Table object directly. I
find it a convenient syntactic shorthand because I'm always using it to get
Hi Leonel --
My brain refuses to put together the words "session locked field". I
understand the part of pickle smashing the values and encoding them as one
string. The bool has something to do with session locking?
I've only looked at the web2py redis code in the most scant way as I wasn't
se worked for me. Kind of weird because when I checked which
> version of python I had running it said 2.7 but perhaps I installed w2p
> with python3.
>
> Anyway, at the end I was suggesting that maybe we could update the book
> some making reference to how things might look with pyt
I agree that back porting web2py code should be straightforward (after all,
it's not rocket science :-D). But maybe we should revisit those modules
and pare them down to minimalist proportions. I really need Auth, complete
with user roles and groups, but there's probably a better way to
minim
Hi Al --
First off, welcome to the web2py group. Next, it's not clear from your
message just what the question is. If you can elaborate on (a) what you
did, (b) what you expected, and (c) what you got, I'm sure someone here can
help
Warm regards,
Joe B.
On Thursday, March 28, 2019 at 2:10:
have
> been allowed. Web3py will use json for sessions or move away from sessions
> completely.
>
> Massimo
>
> On Tuesday, 19 March 2019 21:07:43 UTC-7, Joe Barnhart wrote:
>>
>> Has something changed in the operation of redis to store sessions in
>> web2py wh
Has something changed in the operation of redis to store sessions in web2py
when we use python3 instead of python2? I'm hitting an error in the
py-redis library that complains I can't store a boolean in redis
(unsupported data type). Since this seems to be a well known design
feature of redis
Here's an example from my site:
Field("sender", "reference auth_user",
default=lambda: current.auth.user.id,
represent=db.auth_user._format,
requires=IS_NULL_OR(IS_IN_DB(db,'auth_user.id'))),
As you can see, it can be accessed as the attribute
wser to replace the old one. Note,
> quite incidentally, this bug does not affect Auth because the logout method
> in Auth adds "flash" to the session after logout, which forces a new cookie
> to be sent to the browser.
>
> Anthony
>
> On Thursday, September 27,
Yep.
I'm pretty sure 'fields' is a list so it doesn't need function parentheses.
And since "my_table" and "db['my_table']" are the same:
for f in my_table.fields:
my_table[f].writable=True
Same thing, but sweetened with syntactic sugar. (low calorie)
-- Joe
On Thursday, September 27,
What Anthony said. Only sessions rarely log out. They mostly time out,
which does not show up as an event.
Joe
On Wednesday, September 26, 2018 at 12:13:25 PM UTC-7, mostwanted wrote:
>
> Hi guys, i was wondering if there is a way for me to capture user login
> time and user logout time
>
> R
I love the new(?) capability of storing the session information in a
browser cookie. Mainly because I'm lazy and don't want the responsibility
of determining when to throw out sessions and manage them on my end.
I added this to my app:
session.connect(request, response,
cookie_key="mylittlepo
$.ajax({
data: {a:2, b:3},
url: "{{=URL('loadAdditonalInfo')}}",
success: my_success_fcn(ret)
)};
Something like this, from memory...
You can get more details at the jQuery website. It has excellent docs.
Joe
On Tuesday, September 4, 2018 at 6:23:03 AM UTC-7, Константин Комков wrote:
>
I'm worried about losing control over the db migration process. Using
MySql it is fairly common for the migration process to go wrong, as MySql
doesn't do will with adding and deleting multiple columns. I often need to
drop a few tables, delete the corresponding file in 'databases' and then
f
r* line 2.
>
> So, you can add values from request.vars to form.vars before calling
> .validate() or .process(), and the values will be available in any
> onvalidation callback (of course, you can also refer directly to
> request.vars anywhere).
>
> Anthony
>
>
> On Mon
So I'm trying to use a hidden field to create some unique behavior in a
form. I want to send out the field when the form is first created (using
the hidden=dict(...) keyword on SQLFORM). But later, while processing the
form through the error phase, I want to update that value to a different
v
just the unfortunate collision of design
choices to limit the usefulness of "elements" in this one corner case. The
red flash isn't that bad. I'll just say I'm doing it deliberately to get
the user's attention.
"A feature is a bug as described by Marketi
enclosing DIVs to be
class "warning" also. I'd provide different CSS for the yellow background.
Just thinking out loud here.
On Wednesday, August 22, 2018 at 3:31:14 PM UTC-7, Joe Barnhart wrote:
>
> I'm looking to add "warnings" to forms using (/hijackin
So "session" stuff gets pickled and unpicked which makes sense that dates
might come back as strings. What puzzles me is that it "used to work" so
did pickled date objects used to come back as date objects again? That
would seem like a much bigger change than just this example.
-- Joe
On Tue
I'm looking to add "warnings" to forms using (/hijacking) as much of the
existing form "errors" mechanism as possible. The idea is to provide a
second level check that gives advice rather than drop-dead errors.
I would like it to operate like this:
1. The form is submitted and checked for err
It took me a minute to decipher this post! For the elucidation of others
let me rephrase what I think you wrote...
Some users may not like STORING (not "strong") data in the filesystem.
Storing filesystem data is a bad idea when deploying the same website
across multiple servers, i.e. it hind
Yes, I agree. This needs to be REMOVED FROM THE BOOK. I've just wasted
most of a day before realizing memcache is useless for sessions.
-- Joe
On Friday, January 18, 2013 at 1:03:01 AM UTC-8, Paolo wrote:
>
> Hi all, I have just tried the solution proposed on the issue but it doen't
> work.
How did I not know about this gem earlier?
I've been resorting to executesql() for my heavy joins-within-joins queries
because, well, I thought I had to. The select join syntax doesn't do
nested joins directly and I'd never heard of nested_select.
Wow, what a great tool! I just make my sub-jo
decorate
>> any functions that take arguments (methods always take at least the self
>> argument).
>>
>> On Wednesday, August 1, 2018 at 4:27:02 AM UTC-4, Joe Barnhart wrote:
>>>
>>> Ah, well. It seems a bit beyond me. I think it's failing because I'm
&g
g.__name__ = f.__name__
return g
return decorator
On Wednesday, August 1, 2018 at 12:50:12 AM UTC-7, Joe Barnhart wrote:
>
> Oops, I meant of course;
>
> current.cache.action
>
> instead of
>
> current.cache
>
>
>
>
> On Wednesday, Au
Oops, I meant of course;
current.cache.action
instead of
current.cache
On Wednesday, August 1, 2018 at 12:48:00 AM UTC-7, Joe Barnhart wrote:
>
> You're a fountain of ideas! I missed that one in the book.
>
> I wonder if this would work. Off to go try it...
>
> def
model, prefix,
session, vars,
lang, user_agent, public, valid_statuses, quick)(f)(*c, **d)
g.__name__ = f.__name__
return g
return decorator
On Tuesday, July 31, 2018 at 11:25:10 AM UTC-7, Anthony wrote:
>
> On Tuesday, July 31, 2018 at 1:57:46 AM
I was wondering about this. I tried to search the group but didn't find
anything relevant. Took a look at the source code and it seemed like I
could use in a module which is called to produce a string of Javascript on
demand of an Ajax routine.
Beforehand, I save the global "cache" var in my
Yes, of course you're right. The actual code is generated by this
monstrosity:
@staticmethod
def make_toolbar(buttons, id, opt):
#tb = CAT()
tb = DIV(_id=id, _class=opt.w_toolbar_cls,_style="padding:0 0 0 5px;")
for title, action, href_fcn, key in buttons:
if isinstance(actio
I'm sure this is a consequence of Py3 compatibility, but I"ve noticed
several places where strings are now unicode and it plays havoc with JSON
translation. I'm trying to convert the output of database queries into
JSON and the resulting strings have the shape of:
u'this is a unicode string'
I'm using cache.action with cache_model=cache.disk to play with
optimization of my site. To be sure, this page has a lot going on --
complicated menus using "button" objects among the issues. But I don't
have any circular references, at least as far as I can tell. Still, I get
the error:
Tr
I’d get rid of the idiom:
db.colname==“%s”%pythonvar
Just replace it with:
db.colname==pythonvar
— Joe
--
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)
---
Thank you for pulling back some of the mystery surrounding the scheduler
for me. The module import idea is fabulous and will completely solve my
problem!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.go
So I'm expanding my use of the scheduler -- one of the best features of
web2py -- and I'm running into a "scaling" problem.
I'm going to have perhaps a hundred little functions that the scheduler
inserts into the queue. Now, if I define my little functions in the same
Model page as the schedul
on filter that automatically filters out
>> any records with a future reveal date.
>>
>> Anthony
>>
>>
>> On Sunday, June 10, 2018 at 7:20:19 PM UTC-4, Joe Barnhart wrote:
>>>
>>> Are there any reasons I should not schedule task
tes those items to become
> visible. Or even just add a common filter that automatically filters out
> any records with a future reveal date.
>
> Anthony
>
> On Sunday, June 10, 2018 at 7:20:19 PM UTC-4, Joe Barnhart wrote:
>>
>> Are there any reasons I should not
Are there any reasons I should not schedule tasks days, weeks, or months in
advance in the web2py scheduler? It seems such a fantastic,
general-purpose tool that I'm using it for more and more things in the
site.
Currently I'm considering using it to "reveal" embargo'ed items that should
no
This is sort of a bug, sort of a feature. I just converted to the JSON
version of AppConfig (in the gluon/contrib) and discovered the strings it
produces are all unicode -- even in Python 2.x environments.
I'm not sure of ALL of the ramifications, but I discovered it causes crypt
fields to fai
;)),
. . .
It all works really well and gives me the single point of control I want.
It requires no changes in web2py and works with current, past, and future
versions. And the lazy programmer in me marvels at all the code I don't
have to type.
-- Joe
On Thursday, March 23, 2017
Anybody else seeing this?
.../gluon/contrib/pymysql/cursors.py:166: Warning: (3090, u"Changing sql
mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future
release.")
This Is showing up on the console while running version
2.16.1-stable+timestamp.2017.11.13.23.50.07
Just curio
Actually you don’t want to show the correct number of characters. That gives an
attacker a lot of information.
--
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
Thank you for your help, Anthony.
-- Joe
--
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 because you are subscribed to the Goog
("scm_gt",label=XML(T("SCM %s",(">",,
elapsed_time_field("scm_le",label=XML(T("SCM %s",("≤",,
elapsed_time_field("scy_gt",label=XML(T("SCY %s",(">",,
elapsed_time_field("scy_le",label=X
e why &xx; is "sanitized" to begin with. It seems like an
extreme form of sanitizing, to eliminate any and all special characters
from form labels.
-- Joe
On Wednesday, July 26, 2017 at 5:16:55 PM UTC-7, Anthony wrote:
>
> On Wednesday, July 26, 2017 at 7:43:14 PM UTC-4, Joe
It's even worse than I imagined.
Leaving off the T() operation, I find that my field labeled "LCM >" is
actually sanitized at some point into:
LCM >:
Yes, something in the process has *recognized* the character ">" and
changed it to ">" But the field "LCM ≤" was sanitized into:
LCM ≤:
Ugh. Replace the word "title" with "label" everywhere. Global search and
replace.
--
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 mes
I have field titles which need to indicate "less than or equal" or "greater
than" symbols. HTML provides such escapes with the character sequences
≤ and > respectively. But when I use these characters in the "title"
of a Field, the displayed SQLFORM changes these back into "≤" for
example ins
y 2017 21:34:40 UTC-5, Joe Barnhart wrote:
>>
>> Yes that fix looks exactly on point.
>>
>> -- Joe
>>
>> On Sunday, July 16, 2017 at 3:28:22 PM UTC-7, Leonel Câmara wrote:
>>>
>>> Joe the fix on the DAL wasn't for your problem, Your probl
Government interoperability? Isn't that an oxymoron? You mean, like use
the same frequency radios and stuff?
Sure, you can have me for dinner. Maybe we can scare up some others. I
keep looking under rocks for more Python programmers up here. You'd think
with all this 100+ weather that indo
Yes that fix looks exactly on point.
-- Joe
On Sunday, July 16, 2017 at 3:28:22 PM UTC-7, Leonel Câmara wrote:
>
> Joe the fix on the DAL wasn't for your problem, Your problem was fixed in
> web2py here:
>
> https://github.com/web2py/web2py/pull/1686/commits/ce0b2557470ecb7c92719645293cb00785fe4
You are correct. By using the SQLFORM.factory function the table was,
indeed, different. I blame the lapse on the inability of neurons to
function in the 106 degree heat we're having in the Sacramento area today.
-- Joe
On Sunday, July 16, 2017 at 2:53:10 PM UTC-7, Anthony wrote:
>
> You ment
I think I tried your fix but it didn't work. None of my fields were "common".
Massimo had pointed out the fix on Github.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Re
Found the issue and a workaround see below.
--
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 because you are subscribed to th
Yes... Massimo helped me come up with a workaround for my case.
I am using SQLFORM.factory to create a form to edit two tables joined
together. One table is used to index entries in a bunch of other tables by
a 6-tuple. Since these are all swimming related, the tuple is (sex,
upper_age, lower
Hmm... That's gonna be a problem.
This is occurring in an SQLFORM... which is in a modal pop-up box... over a
tabbed structure with about 5 more SQLFORMS... plus 5 or 6 jQuery
DataTables... all powered by the same basic set of 4 or 5 tables. It will
take a solid day to boil it down to a simpl
As long as we're adding interesting but obscure and little-used web
platforms, I'd like to submit Seaside, the Smalltalk web platform.
Just... well... because Smalltalk!
-- Joe
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source
But Grails borrowed heavily from Rails. And you, Massimo, mentioned that
Rails also provided some "inspiration" for web2py
So by the commutative property of web platforms, web2py and Grails share
some family similarities.
-- Joe
On Thursday, July 13, 2017 at 10:05:54 AM UTC-7, Massimo Di P
I just switched to Version 2.15.1-stable+timestamp.2017.07.10.16.17.24 and
I'm getting a new and very unwelcome error.
ValueError: Field is already bound to a table
Yeah. I knew that. In fact, the field is already bound to exactly the
SAME table in other queries. So what? Why is that now
What he said. But in addition, consider the following:
1. The entire purpose of SQL is to treat data as unordered tables and let
you establish a "relationship" between data in different tables, or within
a single table. To add "order by" to every SQL select statement is a
serious de-optimizat
My experiments are all pretty old. Too old to be useful.
Currently I have commercial websites using web2py and I don't need to do
anything remarkable to make it faster. I just used good design techniques
and didn't do "premature optimization." I'm now re-writing a Rails, site,
a Java site, a
It's hard to take these questions seriously when you haven't described your
speed problem. How is your website performing, and what are the
bottlenecks you've found?
Yes, many people, including myself, have experimented with pypy and web2py.
If you're observant, you'll notice there are many m
No.
On Sunday, May 28, 2017 at 8:50:15 AM UTC-7, Ron Chatterjee wrote:
>
> I understand that. No one is disputing better coding better performance.
> But the question is:
>
> Cython wrapper (
>
> Default. Py
>
> )
> Is it possible. If so how?
>
>
--
Resources:
- http://web2py.com
- http://web
s the direct parent, it does not check up the "tree". And all of the
helpers are subclasses of DIV, which itself is a subclass of XmlComponent.
Just askin'...
On Friday, May 26, 2017 at 12:05:25 PM UTC-7, Joe Barnhart wrote:
>
> I dunno how this affects me and not everyone else
I dunno how this affects me and not everyone else who uses this tool. It
looks like the default JSON serializer for web2py has a huge flaw. But if
that were true, it would have been noticed by lots 'o people before. So it
must be impure thinking on my part.
My objects are being serialized wi
"Make it faster" is a nice goal, but it has many different components, and just
compiling everything with cython is not an easy way out.
The path to take, like with any software project, is to implement the function
that you need first. If, and only if, there is a performance problem, you
care
"Invalidate".was supposed to be "onvalidation" before autospell worked its
wonder...
--
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 me
It looks like just swapping the lines works. It's the simplest example of
using hidden fields and it works even in my more complicated case. I was
hoping to be "clever" and doing something in "invalidate" after the form was
validated but before it was stored. But the logic in the "validate" a
who cut his teeth on
cvs.
-- Joe
On Tuesday, May 9, 2017 at 7:35:08 AM UTC-7, Anthony wrote:
>
> Good point. Maybe submit a PR to the book repo.
>
> On Monday, May 8, 2017 at 5:07:01 PM UTC-4, Joe Barnhart wrote:
>>
>> In the section about SQLFORM, the description of h
You are correct sir.
The table has three "reference" fields and their default validators were
the unforgiving type. Since this was a special case in which it was OK if
the references were missing, I just nuked the validators before doing the
"validate_and_insert" by setting the "requires=Non
So I'm using "validate_and_insert" to, well, validate and insert some
values. Its a simple function and easily understood:
def validate_and_insert(self, **fields):
response, new_fields = self._validate_fields(fields)
if not response.errors:
response.id = self.inse
In the section about SQLFORM, the description of hidden fields is
demonstrably wrong. The code example is:
form.vars.a = request.vars.a
form = SQLFORM(..., hidden=dict(a='b'))
Since the variable "form" is created on the second line, it is not
available on the first as the target of an assignm
But are you sure that's the right approach? I force problems with
lightweight clients (i.e. phones) doing complicated layout generation.
-- Joe
On Friday, April 21, 2017 at 8:19:15 AM UTC-7, Massimo Di Pierro wrote:
>
> Which is why I hate bootstrap and we have to move to client side
> genera
change is
definitely essential for SELECT objects. Now, it could be limited to only
SELECT objects, but there is no harm in broadening it to all widgets.
Warm regards,
Joe
On Saturday, April 1, 2017 at 12:51:55 PM UTC-7, Anthony wrote:
>
> On Friday, March 31, 2017 at 5:41:49 PM UTC-4
Something's wrong! The text came out garbled on the screen shots. I can't
read a thing!
;-)
On Sunday, April 16, 2017 at 11:16:27 AM UTC-7, Ramos wrote:
>
> My humble doc management app still in testing, with workflows...
> I have email templates looking very nice
>
> 2017-04-16 15:37 GM
a(value)
if reterr is not None:
break
if reterr is not None:
for ea in self.second:
retval,reterr = ea(value)
if reterr is not None:
break
return (retval, reterr)
On Monday, April 10,
This is one of those head-scratchers Marcelo. Note the "onvalidation"
function is called AFTER the validation is done on the form. By then it's
too late to prevent the validators from being run on the hidden fields. I
could monkey around with the added "error" stuff after the fact, but that's
Well, I'm not sure there's a nice general solution to this one. Since
"show_if" is kind of an add-on to Field and isn't really a part of
Expression or Validator or anything else. Here's what I came up with...
First I created my set of "show_if" fields and set their validators to the
existing
I appreciate the new "show_if" attribute for Fields but I wonder if its
action could be enhanced by one change...
When I have a form with optional fields, I would like to set a validator on
the field's value should it be supplied. I can always set it to
IS_EMPTY_OR(blah) but this isn't strictl
Anthony --
One more tiny but not insignificant detail...
I found I had to add "requires=[]" to the custom.widget:
[form.custom.widget[f.name].update(_readonly=True, requires=[]) for f in
readonly_fields]
Otherwise, the field keeps the 'requires' of the original Field and the
check fails.
urning, so when the
> form is processed, those fields will not be included in the database write.
>
> Anthony
>
> On Friday, March 31, 2017 at 5:25:59 AM UTC-4, Joe Barnhart wrote:
>>
>> I'm going a little nuts with forms that have readonly fields. Examples
>>
I'm going a little nuts with forms that have readonly fields. Examples are
forms where some fields are shown to the user so they can see the contents,
but they aren't allowed to change them. For example, an "expiration date"
for a subscription. They can see when it expires, but they can't j
That's kinda clever. I may think of that!
-- Joe
On Thursday, March 23, 2017 at 4:19:05 PM UTC-7, Anthony wrote:
>
> Note, you might as well also add 'type': 'string' to your dictionary, and
> maybe 'length': 20. You can also give yourself some flexibility by creating
> a function:
>
> def ph
I'm not sure what you're doing with a single-quote table name (?) but I
observed your statements have different results after string substitution.
In the first case, substituting the "Single' Quote" string results in:
"SELECT * FROM table1 WHERE name = Single' Quote LIMIT 1"
Whereas in your "re
Just a couple of philosophical comments...
Whenever I find that the web2py platform is "forcing" me to code in large
volumes and produce ugly, quirky code which I *know* will be hard to
maintain, I stop myself and take another look at how I'm trying to
accomplish my task. I have this philosoph
1 - 100 of 568 matches
Mail list logo