gluon/validators.py lines 403-405:
rows = self.dbset(field == value).select(limitby=(0, 1))
if len(rows) > 0 and str(rows[0].id) != str(self.record_id):
return (value, self.error_message)
- line 404: a field with name 'id' is required, but legacy tables may
not have a
have sent you an email.
On Nov 21, 2:25 am, Julio wrote:
> Hey Richard,
>
> I am working on a similar interface 100% web2py, what really would
> help me is some sort of technical workflow, or documentation regarding
> the handling of the posts, up/down pointing system, notification/
> subscript
I have tried the rpxAuth module and it allowed me to login using a
google account.
Did not get auth.user when calling from web2py.
I decided to try the original prxAuth module which does not allow for
local login and I have the same problem.
I have been looking at this for a few hours and not s
scratch that!!!
I had the full url to auth.settings.rpx_login_domain='http://localhost:
8000'/init/default/index', should have been just 'http://localhost:
8000'
Thanks again guy's for this code:)
On Nov 21, 12:41 pm, murray3 wrote:
> I have tried the rpxAuth module and it allowed me to login us
Is it possible to append Recaptcha to a SQLFORM, or SQLFORM.factory.
This would be ideal.
form = SQLFORM(db.table)
if somesettings.recaptcha=True
form.append(Recaptcha())
-Thadeus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
And access it through custom form with..
{{=form.custom.widget.recaptcha}}
-Thadeus
On Sat, Nov 21, 2009 at 8:11 AM, Thadeus Burgess wrote:
> Is it possible to append Recaptcha to a SQLFORM, or SQLFORM.factory.
>
> This would be ideal.
>
> form = SQLFORM(db.table)
>
> if somesettings.recaptc
example:
In [1]: db = DAL('informix://oli:x...@suse101/stammdat')
In [2]: db.define_table("personen",
...: Field("name", length=80),
...: Field("anz", "integer"),
...: primarykey=["name"],
...: migrate=False
...: )
In [3]: a = db().select(db.personen.name)[0].name
I
Calm down please. Speaking louder does not help make your point any
better.
If a user requests "en, fr, sp, pl" and the app only has a translation
file for "pl" and the app does not tell web2py that "en" does not need
a translation file, choosing "pl" is the correct behavior.
I think there is no
Something like this?:
def index():
use_recaptcha = True
recaptcha_public = "..."
recaptcha_private = "..."
captcha = lambda f,v: Recaptcha(request,
recaptcha_public,recaptcha_private) if use_recaptcha else ''
form = SQLFORM.factory(Field('test',requires=IS_NOT_EMPTY()),
Hi Hans, I have your patch and I will be applying it tomorrow.
Unfortunately the added experimental support for legacy databases
opens issues like this. If we assume less about the table structure
then more checks are required which may result in more complex and
slower code. Let's all think abou
Currently you cannot. Support for legacy databases is not on the same
foot as support for databases created by web2py. In particular as you
point out the encoding is an issue.
One way around is use a custom field type.
On Nov 21, 8:58 am, Hans Murx wrote:
> example:
>
> In [1]: db = DAL('inform
Ideally I would be able to create a form using SQLFORM(db.table) and then
insert the recaptcha field after the fact. I need to be able to display the
field in form.custom. But I may just be dreaming here :)
Using your example, it gives a no_data error
-Thadeus
On Sat, Nov 21, 2009 at 9:25 AM,
IS_NOT_IN_DB(legacy=True)?
-Thadeus
On Sat, Nov 21, 2009 at 9:33 AM, mdipierro wrote:
>
> Hi Hans, I have your patch and I will be applying it tomorrow.
>
> Unfortunately the added experimental support for legacy databases
> opens issues like this. If we assume less about the table structure
The strange thing is that the captcha validation actually succeeds
(you can test by putting an incorrect value in the captcha form and
see if fail properly). I'm not sure why form.accepts is putting
no_data into form.errors. Perhaps a bug?
On Nov 21, 10:49 am, Thadeus Burgess wrote:
> Ideally I
It seems that setting a default on the field fixes it:
form = SQLFORM.factory(Field('test',requires=IS_NOT_EMPTY()),
Field('test2',widget=captcha,default='')
)
On Nov 21, 11:34 am, "mr.freeze" wrote:
> The strange thing is that the captcha v
I believe it is the way that SQLFORM looks for data in request.vars.
It will look for a var with the name of the field...
so
Field('recaptcha', widget=captcha)
It is expecting a request.vars.recaptcha, which does not exist.
You're right, setting default does fix it, sounds like a bug...
So it
How do you append a Field() to SQLFORM? Does not look like it is possible.
-Thadeus
On Sat, Nov 21, 2009 at 11:47 AM, Thadeus Burgess wrote:
> I believe it is the way that SQLFORM looks for data in request.vars.
>
> It will look for a var with the name of the field...
>
> so
>
> Field('recapt
Mainly because I really get agitated when I have to do silly things such as
if do_captcha:
form = SQLFORM.factory(db.table.field1, db.table.field2,
db.table.field3, Field('anti_spam', widget=captcha, default=''))
else:
form = SQLFORM(db.table)
-Thadeus
On Sat, Nov 21, 2009 at 11:49 AM
And unfortunately, it seems that using Recaptcha in a plugin will not work.
ajax_trap seems to be keeping anything from happening. Works fine outside of
the plugin
It also does not work for the following
LOAD(... ajax=True)
LOAD(... ajax_trap=True)
LOAD(... ajax=False, ajax_trap=False)
-Thadeus
The form submits to the server, and the data ends up getting posted.
However when the page refreshes, it goes blank and freezes with the message
"reading api-secure.recaptcha.net"
-Thadeus
On Sat, Nov 21, 2009 at 12:20 PM, Thadeus Burgess wrote:
> And unfortunately, it seems that using Recap
I know what you mean. I don't think it's possible as the form is
built SQLFORM's __init__ function. You might have some luck
dynamically building a collection of fields then passing them like so:
form = SQLFORM.factory(*fields)
On Nov 21, 11:56 am, Thadeus Burgess wrote:
> Mainly because I re
I will do this in functions, so resources only get allocated if needed.
def captcha_form():
return SQLFORM.factory(db.table.field1, db.table.field2,
Field("anti_spam", widget=captcha, default='')
def normal_form():
return SQLFORM(db.table)
if docaptcha:
form = captcha_form()
else
form
my suggested patch for this issue (self.record_id is a dict with
keyedTables):
suse101:~/web2py-1436/gluon # diff validators.py.ori validators.py
404,405c404,410
< if len(rows) > 0 and str(rows[0].id) != str(self.record_id):
< return (value, self.error_message)
---
> i
http://static.thadeusb.com/web2py_checkboxes_fail.png
Pleeaze fix!!!
I have a patch, but it is not backwards-compatible.
Is this an area where it is a bug, or a feature to have multiple error
messages for checkboxes/radio widgets?
-Thadeus
--~--~-~--~~~---~--~--
On Sat, Nov 21, 2009 at 9:17 AM, mdipierro wrote:
>
> If a user requests "en, fr, sp, pl" and the app only has a translation
> file for "pl" and the app does not tell web2py that "en" does not need
> a translation file, choosing "pl" is the correct behavior.
>
You have your head down in the code
Maybe we can give DAL() an optional extra argument 'db_codec' with
default 'utf-8'.
>> db = DAL('informix://oli:x...@suse101/stammdat', db_codec='latin-1')#
>> 'latin-1' instead of 'utf-8' here
whenever we retrieve string values as type str from a table we convert
them to unicode with code
Can you post some example code that produces the effect? Just want to
make sure I'm understanding the problem correctly.
On Nov 21, 1:55 pm, Thadeus Burgess wrote:
> http://static.thadeusb.com/web2py_checkboxes_fail.png
>
> Pleeaze fix!!!
>
> I have a patch, but it is not backwards-compatibl
form = SQLFORM.factory(Field('multiple_options', requires=IS_IN_SET(('Hi',
'Milk', 'Mom', 'Love', 'Santa')), widget=SQLFORM.widgets.checkboxes.widget))
Submit the form without selecting anything, and it displays the error
message on each INPUT() helper.
You can also change widget to SQLFORM.widge
It is possible to use several items in IS_IN_DB label, but how to use
column name from refrence table?
For example 3 tables:
type_class (type_class_name)
type (type_class_id, type_name)
detail (type_id, detail_name)
I can do for "requires" in detail table this:
requires=IS_IN_DB(db, 'type.id',
I am reviewing available wikis for (initially) my personal use, but
hope to
then go on to something that's more widely available.
Prefer that wiki be based on Python (although vast majority use PHP)
MoinMoin looks like a good choice so far. Has anyone crafted a wiki
that uses wb2py?
Thanks
--~
Although you may be able to do this, captcha is not a widget because
as pointed out it is not a field.
This is the best way.
form[0].append(TR('',captcha, ''))
Massimo
On Nov 21, 12:39 pm, Thadeus Burgess wrote:
> I will do this in functions, so resources only get allocated if needed.
>
> def
I will test it. can you please email it to me. Thanks.
On Nov 21, 12:49 pm, Hans Murx wrote:
> my suggested patch for this issue (self.record_id is a dict with
> keyedTables):
>
> suse101:~/web2py-1436/gluon # diff validators.py.ori validators.py
> 404,405c404,410
> < if len(rows) > 0 an
Yarko please stop it until we get other opinions.
I have answered this question two times already.
You can say it again and again it will not change my opinion.
Yes. The PyCon registration code (not web2py) had a bug. It was
missing
T.current_languages=['en','en-us']
T.force(T.http_accep
Hans you have clearly thought this through. I already have two patches
pending from you. May I ask you to consolidate your patches with this
one and send it to me? Thank you.
Massimo
On Nov 21, 3:27 pm, Hans Murx wrote:
> Maybe we can give DAL() an optional extra argument 'db_codec' with
> defa
Returning to the theme about install hashlib in python 2.4,, excuse my
ignorance, but is it possible to install these packages in a shared
environment? (assuming I do not have root access)
Regards
Jose Eloy Torres
--~--~-~--~~~---~--~~
You received this message be
On Sat, Nov 21, 2009 at 5:55 PM, mdipierro wrote:
>
> Yarko please stop it until we get other opinions.
> I have answered this question two times already.
> You can say it again and again it will not change my opinion.
>
> Yes. The PyCon registration code (not web2py) had a bug. It was
> missing
Here's a lame workaround. It's a widget that removes all of the error
divs except the last one:
def checkboxes_widget(f,v):
wrapper = DIV(_id="%s_wrapper" % f.name)
inp = SQLFORM.widgets.checkboxes.widget(f,v)
scr = SCRIPT('jQuery("div[id=\'%s__error\']").slice(0,-1).remove
();' %
No. We have discussed implementing this. The problem is that the only
efficient way to do this is via a join. Without a join it would be
slow. By using a join it would not work on GAE. To make it efficient
on GAE one would have to denormalize or cache them. I think these are
important design issue
well' This is a bug. I think the proper fix would be to edit html.py
and make sure that only checked boxes display the error.
On Nov 21, 6:15 pm, "mr.freeze" wrote:
> Here's a lame workaround. It's a widget that removes all of the error
> divs except the last one:
>
> def checkboxes_widget(f,v):
Yes. The Web2py wiki is made using web2py...
On Nov 21, 9:38 am, rjeffries wrote:
> I am reviewing available wikis for (initially) my personal use, but
> hope to
> then go on to something that's more widely available.
>
> Prefer that wiki be based on Python (although vast majority use PHP)
>
>
http://wiki.web2py.com/Home
On Nov 21, 7:18 pm, waTR wrote:
> Yes. The Web2py wiki is made using web2py...
>
> On Nov 21, 9:38 am, rjeffries wrote:
>
> > I am reviewing available wikis for (initially) my personal use, but
> > hope to
> > then go on to something that's more widely available.
>
>
The view is not processed on an ajax request. If I am sending ajax
requests to a controller that also serves a page, then I like to send
a variable with the ajax request to let me know:
def index():
if request.vars.is_ajax:
return DIV('this is an ajax request')
...do normal proce
If the ajax is performed by a
{{=LOAD('plugin',ajax=True)}}
or
{{=LOAD('plugin',ajax_trap=True)}}
the plugin actions can do:
if request.env.http_web2py_component_location:
# it was an ajax request
On Nov 21, 9:06 pm, "mr.freeze" wrote:
> The view is not processed on an ajax request. If
43 matches
Mail list logo