[web2py] Re: How to edit boolean fields via one dropdown widget

2021-11-15 Thread Horst Horst
Thanks for your reply, Jim. Unfortunately the table is actually auth_user, the boolean fields are extensions which I defined via auth.settings.extra_fields[auth.settings.table_user_name] = [...] Unless there's a very simple way to replace or customize the builtin user profile related funtions,

[web2py] How to edit boolean fields via one dropdown widget

2021-11-14 Thread Horst Horst
I have a table with two boolean fields. All four combinations used to be meaningful, but now only three are. I'd like to present the three options in one dropdown list instead of two checkboxes. Is this possible and how? -- Resources: - http://web2py.com - http://web2py.com/book (Documentatio

[web2py] Re: How to not clear SQLFORM after it's accepted

2018-05-25 Thread Horst Horst
Thanks, this does the job. Sorry for not RTFM. -- 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

[web2py] How to not clear SQLFORM after it's accepted

2018-05-25 Thread Horst Horst
I have a "contact form" page using a simple, self-submitting SQL form for filling in message, email address etc. After the form is accepted, the server tries to send an email. In case this fails, there's response.flash error message, and I'd like to just present the form again, so that users at

[web2py] A simple way to catch and retry a failed form submit?

2017-04-21 Thread Horst Horst
On my site (sympathetic-resonances.org), users edit complex forms. Part of the form is musical data passed as JSON in a hidden form field, where a JS frontend reads it from and writes it to. The pages themselves are submitted as regular forms. I have a few users in countries with very unreliabl

[web2py] Re: Non-users getting permissions by setting auth.settings.everybody_group_id?

2016-11-07 Thread Horst Horst
e @auth.requires_permission decorator, that > will by default also require login. Otherwise, if you want to use > auth.has_permission, you must separately check whether the current user is > logged in. > > > Anthony > > On Wednesday, November 2, 2016 at 7:04:16 PM UTC-4,

[web2py] Non-users getting permissions by setting auth.settings.everybody_group_id?

2016-11-02 Thread Horst Horst
I've found a behavior in 2.14.6 which makes me scratch my head. I have set auth.settings.everybody_group_id = 2 in order to make every user part of the "user" group (2). The auth_membership reflects this explicitely for each added user. I have granted several permissions to group 2, e.g. one

[web2py] Re: "auth.settings.email_case_sensitive=False" not working?

2014-05-16 Thread Horst Horst
t; Have you customized the auth_user table in any way (in particular, > anything that would prevent the default validators from being added to the > email field)? > > On Friday, May 16, 2014 8:05:22 AM UTC-4, Horst Horst wrote: >> >> It seems (at least in my case) the con

[web2py] Re: "auth.settings.email_case_sensitive=False" not working?

2014-05-16 Thread Horst Horst
;, length=80), ] Am Freitag, 16. Mai 2014 15:05:53 UTC+2 schrieb Anthony: > > Have you customized the auth_user table in any way (in particular, > anything that would prevent the default validators from being added to the > email field)? > > On Friday, May 16, 2014

[web2py] Re: "auth.settings.email_case_sensitive=False" not working?

2014-05-16 Thread Horst Horst
h that setting, upon registration, it converts the email to > lowercase before storing in the database, and then on login, it looks for > the lowercase version of the email in the database. Try converting all > email addresses already in the database to lowercase and see if it works &g

[web2py] "auth.settings.email_case_sensitive=False" not working?

2014-05-16 Thread Horst Horst
I'm running web2py 2.9.5 and set auth.settings.email_case_sensitive to False in my app, because I thought it'd be a good idea. Now I have a bunch of users complaining that they can't log in, and figured out that they registered with an email address which contains capital letters. I tried mysel

[web2py] Re: Pre-registering users

2014-04-22 Thread Horst Horst
TC+2 schrieb Massimo Di Pierro: > > Please open a ticket: > - the reset password should display password strenght > - there should be an option to automatically login after reset password. > > On Monday, 21 April 2014 16:25:20 UTC-5, Horst Horst wrote: >> >> Thanks, Massimo

[web2py] Re: Pre-registering users

2014-04-21 Thread Horst Horst
stered_users: > auth.messages.reset_password = "I have shared a document with you click > on the link %(link)s to reset your password, your document is . bla bla > bla" > auth.email_reset_password(user) > > On Friday, 7 March 2014 08:14:21 UTC-6, Horst Horst wrote: >&

[web2py] Re: Pre-registering users

2014-03-07 Thread Horst Horst
so, setup the required > permissions then. Once that controller is done, redirect them where they > need to go. > > > ...just my thoughts on your issue. > > > -Jim > > > > On Friday, March 7, 2014 8:14:21 AM UTC-6, Horst Horst wrote: >> >> I'd

[web2py] Pre-registering users

2014-03-07 Thread Horst Horst
I'd like to implement a feature similar to sharing Google docs or Dropbox: If you share something with a non-registered user, he gets a notification email, but once he signed up, the permissions are already in place. Programmatically registering users should be no problem, but how can I show th

Re: [web2py] pg8000 driver that comes with web2py 2.8.2 is not supporting JSON field type?

2014-02-25 Thread Horst Horst
Best regards > > > > Mariano Reingart > http://www.sistemasagiles.com.ar > http://reingart.blogspot.com > > > On Mon, Feb 24, 2014 at 10:18 AM, Horst Horst > > wrote: > >> I'm getting a: >> >>type oid 114 >> not mapped to py type

[web2py] pg8000 driver that comes with web2py 2.8.2 is not supporting JSON field type?

2014-02-24 Thread Horst Horst
I'm getting a: type oid 114 not mapped to py type I'm wondering what's the best thing to do now? Currently I'm considering: - using TEXT instead. But my former JSON strings are then enclosed by "|" which leads to new errors - updating gp8000 (there seems to be a newer version, but the vers

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
s all backups referring to it. Am Montag, 17. Februar 2014 14:02:36 UTC+1 schrieb Anthony: > > On Monday, February 17, 2014 7:24:24 AM UTC-5, Horst Horst wrote: >> >> I don't understand the rationale behind the way record versioning is >> implemented: If you delete a

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
a row with dependants record on it would mean dropping also the > dependant record(s), that can't be then "archived" properly. > > On Monday, February 17, 2014 2:02:36 PM UTC+1, Anthony wrote: >> >> On Monday, February 17, 2014 7:24:24 AM UTC-5, Horst Horst wrot

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
Thanks, Anthony. In fact, I was completely missing the other enable_record_versioning section in the DAL chapter. Am Montag, 17. Februar 2014 14:02:36 UTC+1 schrieb Anthony: > > On Monday, February 17, 2014 7:24:24 AM UTC-5, Horst Horst wrote: >> >> I don't understand t

[web2py] Re: A few suggestions for fixes to the web2py book

2014-02-17 Thread Horst Horst
That's what I'd indeed do if if was my book. Am Sonntag, 16. Februar 2014 05:49:23 UTC+1 schrieb Tim Richardson: > > Perhaps we just delete the entire reference to pyjamas and see if a 0.9 > release ever happens? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

[web2py] Re: Can't delete records in appadmin any more after enabling auth.enable_record_versioning

2014-02-17 Thread Horst Horst
27;s weird currently is that a query shows the latter, but delete works on the former. Am Montag, 17. Februar 2014 13:09:36 UTC+1 schrieb Horst Horst: > > I understand that enable_record_versioning() simply makes delete set the > records' is_active flags to False, but I'm sur

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-17 Thread Horst Horst
r if any of the _before_delete callbacks returns a > non-falsey value. There also does not appear to be a way to verify for > certain that a particular table is being archived via > enable_record_versioning. > > Anthony > > On Saturday, February 15, 2014 11:35:02 AM UTC-5, H

[web2py] Can't delete records in appadmin any more after enabling auth.enable_record_versioning

2014-02-17 Thread Horst Horst
I understand that enable_record_versioning() simply makes delete set the records' is_active flags to False, but I'm surprised that this also affects addadmin. This means I can't delete records any more for real. As a web2py newbie, this, together with my other record versioning problem (https:/

[web2py] Re: "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-15 Thread Horst Horst
bruar 2014 05:09:54 UTC+1 schrieb Massimo Di Pierro: > > del table[id] > > is more picky. Raises an exception if id is not int and if the record does > not exist. > > On Friday, 14 February 2014 16:23:04 UTC-6, Horst Horst wrote: >> >> I have a controller function for

[web2py] Re: Cannot access virtual fields within a IS_IN_DB format function?

2014-02-14 Thread Horst Horst
Unfortunately, row.translator.custom_name doesn't work either: 'Row' object has no attribute 'translator' -- 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) ---

[web2py] "del db.my_table[id]" shortcut not working any more after enabling record versioning

2014-02-14 Thread Horst Horst
I have a controller function for record deletion which worked reliably for quite some time. Today I've added added auth.enable_record_versioning(db) to my model file for the first time (my tables had auth.signature fields already). Since then, I get No such record: 230 tickets wheneve

[web2py] A few suggestions for fixes to the web2py book

2014-02-14 Thread Horst Horst
Meta-question: Should I rather post things like this to the issue tracker? 1. In http://web2py.com/books/default/chapter/32/07/forms-and-validators#Validators, the paragraph "IS_IN_SET" says: The elements of the set must always be strings unless this validator is preceded by IS_INT_IN_RANGE (

[web2py] Cannot access virtual fields within a IS_IN_DB format function?

2014-02-14 Thread Horst Horst
Given this table... translator_format = lambda row: row.custom_name if (row.custom_name and row.custom_name.strip()) else "%s -> %s" %( db.notation(row.source_notation_id).notation_name, db.notation(row.target_notation_id).notation_name) db.define_table("translator",

[web2py] Form custom widget to grow/shrink multiple list:string input fields in parallel?

2014-02-10 Thread Horst Horst
I have a table with multiple list:string fields, like db.define_table("problem", # ... many other fields Field("a", "list:string"), Field("b", "list:string"), Field("c", "list:string"), # ... many other fields ) SQLFORM renders nice widgets for each of the fields with little + and - bu

[web2py] Re: How to get plain strings from simplejson.loads?

2014-02-10 Thread Horst Horst
plain strings, not unicode strings. It can all be fixed, but the simplest thing would be to not to pass unicode objects in the first place. Am Montag, 10. Februar 2014 11:30:57 UTC+1 schrieb Tim Richardson: > > > > On Monday, 10 February 2014 19:51:37 UTC+11, Horst Horst wrote:

[web2py] Re: How to get plain strings from simplejson.loads?

2014-02-10 Thread Horst Horst
d-of-unicode-ones-from-json-in-python Am Montag, 10. Februar 2014 01:07:35 UTC+1 schrieb Tim Richardson: > > Do you understand what the u means? (i.e. it means you have a unicode > string) > > > > On Monday, 10 February 2014 10:08:31 UTC+11, Horst Horst wrote: >> >>

[web2py] How to get plain strings from simplejson.loads?

2014-02-09 Thread Horst Horst
>>> from gluon.contrib.simplejson import loads, dumps >>> loads(dumps("Hello")) u'Hello' How can I make loads give me a 'Hello' here instead of u'Hello'? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goo

[web2py] Ouch! It looks like 3L, it asserts like 3L, it quacks like 3L, but it's a gluon.dal.Reference

2014-01-27 Thread Horst Horst
I've just spent several hours debugging a mysterious bug until I figured out that what I thought was a long int (passed trough several layers of code) was in fact a gluon.dal.Reference instance. I think I would have found it immediately if repr(gluon.dal.Reference(3)) had been 'Reference(3L)' r

[web2py] Re: How to change SQLFORM values after submission and then show the form again?

2014-01-24 Thread Horst Horst
onvalidation function, or is validation > unnecessary in that case (if the latter, you can just move all the > translate logic to before validation). > > Anthony > > On Thursday, January 23, 2014 8:01:54 AM UTC-5, Horst Horst wrote: >> >> The controller is pretty leng

[web2py] Re: How to change SQLFORM values after submission and then show the form again?

2014-01-23 Thread Horst Horst
The controller is pretty lengthy, find a stripped-down version below. Yes, I'm using several custom buttons which submit the form via JS, there's a Save, a Save As, and a Translate button, identified by a hidden, JS-generated form variable. The Translate button translates some form content int

[web2py] How to change SQLFORM values after submission and then show the form again?

2014-01-22 Thread Horst Horst
In my record-update controller, after SQLFORM.validate(), I'd like to programmatically change some of the submitted form values, and then present the form again (with the changed values) for further editing. Imagine a sort of autocomplete of partially filled forms. My controller has the standa

Re: [web2py] web2py takes about 30secs to launch (on MacBook Pro, OS X 10.9.1)

2014-01-12 Thread Horst Horst
host" that > your machine has a name that is neither resolvable by dns nor by /etc/hosts > lookup. To fix the problem try to add the following line in your > /etc/hosts: > > 127.0.0.1 > > > > 2014/1/12 Horst Horst > > >> ...and guess what what: I&#x

[web2py] web2py takes about 30secs to launch (on MacBook Pro, OS X 10.9.1)

2014-01-12 Thread Horst Horst
...and guess what what: I've been working on my first web2py project since almost three month, and thought this was normal! (I hear you laughing.) Until yesterday when I had my WLAN turned off and web2py launched almost instantly. I couldn't believe it, launched the debugger, and traced the pro