Re: [web2py] Re: remove dups when using IS_IN_DB validator

2010-11-22 Thread Audra Rudys
That worked -- thanks! On Mon, Nov 22, 2010 at 4:58 PM, mdipierro wrote: > IS_IN_DB(db,'field.id','%(name)s',groupby=db.field.name) > > On Nov 22, 4:23 pm, Audra Rudys wrote: > > I have a form that only allows a subset of choices for some of the > fields,

[web2py] remove dups when using IS_IN_DB validator

2010-11-22 Thread Audra Rudys
I have a form that only allows a subset of choices for some of the fields, so I'm using a SQLFORM Factory and the IS_IN_DB validator to generate a list of allowable values for the drop down list. The determination of allowable values requires a join, which generates some duplicates in the drop dow

Re: [web2py] Re: Do read-only fields get submitted with forms?

2010-11-19 Thread Audra Rudys
ou have a security vulnerability. > > On Nov 19, 1:41 pm, Audra Rudys wrote: > > I need to get a value from a read-only field when I submit my form, but > the > > value comes across as none when I reference it (form.vars.field). Other > > values from the same record are

Re: [web2py] Re: need help with update query where field names the same in source & dest tables

2010-11-19 Thread Audra Rudys
dest.field = (SELECT src.field FROM > src, dest WHERE src.dest_id = dest.id);") > > > On Nov 19, 11:21 am, Audra Rudys wrote: > > Oops, for logical clarity, it should be: > > UPDATE dest > > SET dest.field = > > (SELECT src.field FROM src, dest WHERE src.dest_

[web2py] Do read-only fields get submitted with forms?

2010-11-19 Thread Audra Rudys
I need to get a value from a read-only field when I submit my form, but the value comes across as none when I reference it (form.vars.field). Other values from the same record are accessible, so I think my syntax is right. I'm thinking of creating a hidden field and putting the value into it so t

Re: [web2py] Re: help with action when record deleted / crud.settings.update_ondelete bug?

2010-11-19 Thread Audra Rudys
f each page after the one deleted > > 2) when registering the callback no () > > crud.settings.update_ondelete = deletepage > > > On Nov 19, 9:09 am, Audra Rudys wrote: > > My application follows a book metaphor -- record with number of pages and > > subrecords wit

[web2py] Re: need help with update query where field names the same in source & dest tables

2010-11-19 Thread Audra Rudys
; > On Fri, Nov 19, 2010 at 11:20 AM, Audra Rudys wrote: > >> I figured out a way to do this... rewrote my query as a nested select: >> UPDATE dest SET dest.field = (SELECT src.field FROM src, dest WHERE >> src.dest_id = dest.id); >> >> Does SQLite support UPD

[web2py] Re: need help with update query where field names the same in source & dest tables

2010-11-19 Thread Audra Rudys
Oops, for logical clarity, it should be: UPDATE dest SET dest.field = (SELECT src.field FROM src, dest WHERE src.dest_id = dest.id); On Fri, Nov 19, 2010 at 11:20 AM, Audra Rudys wrote: > I figured out a way to do this... rewrote my query as a nested select: > UPDATE dest SET dest

[web2py] Re: need help with update query where field names the same in source & dest tables

2010-11-19 Thread Audra Rudys
On Fri, Nov 19, 2010 at 10:56 AM, Audra Rudys wrote: > This ought to be simple and yet... > How do I write the following query in web2py? > UPDATE dest, src > SET dest.field = src.field > WHERE src.dest_id = dest.id > > I only need to run it once. Tried via database admin

[web2py] need help with update query where field names the same in source & dest tables

2010-11-19 Thread Audra Rudys
This ought to be simple and yet... How do I write the following query in web2py? UPDATE dest, src SET dest.field = src.field WHERE src.dest_id = dest.id I only need to run it once. Tried via database administration module, but the problem seems to be that the source and destination field names ar

[web2py] help with action when record deleted / crud.settings.update_ondelete bug?

2010-11-19 Thread Audra Rudys
My application follows a book metaphor -- record with number of pages and subrecords with consecutive page numbers. I'm using crud.update and wish to run a piece of code to update the total number of pages on the record and reassign page numbers when a record is deleted to keep them consecutive.

[web2py] Bug in saving changes to the about page for my application?

2010-11-14 Thread Audra Rudys
I just downloaded Version 1.89.1 source code version of web2py to upgrade (I skipped a few versions, in case that matters.) When I go to the "about" screen and click edit, I get an edit window and can type changes, but I can't save them. I clicked the disk icon in the upper left corner, but noth

[web2py] how to allow only admin to make changes

2010-10-14 Thread Audra Rudys
I have an app with settings (think drop down list values for one of my tables) that I'd like to allow registered users to add values to but only an administrator to edit/delete. Could I use the application administrator for this purpose? Is there a way to check from a controller function if the A

Re: [web2py] Re: how do I redirect from add to edit?

2010-10-14 Thread Audra Rudys
; See thread: > > http://groups.google.com/group/web2py/browse_thread/thread/373ba9cee9ea320c/a5c8093e3a6ab2e0?lnk=gst&q=id+of+last+record+added+using+crud#a5c8093e3a6ab2e0 > > On Oct 14, 2:10 am, Audra Rudys wrote: > > How does one capture the id of a newly created record for redire

[web2py] how do I redirect from add to edit?

2010-10-13 Thread Audra Rudys
How does one capture the id of a newly created record for redirect? Desired workflow: User adds record, pushes submit, record added and goes into "edit mode" for further work. I have 2 controls: add(using crud.create) and update (using crud.update). After adding, I'm trying to redirect to update

Re: [web2py] Re: need help on join with aliased tables

2010-10-13 Thread Audra Rudys
> > >>> print rows[0] > , 'work': {'update_record': at 0x1010d6578>, 'cover_color': > 1, 'id': 1, 'delete_record': at 0x1010d6500>, > 'title_color': 1}>, 't': }> > >>> prin

Re: [web2py] Re: need help on join with aliased tables

2010-10-12 Thread Audra Rudys
t; accessible_works=db().select(db.work.ALL, t.html_code, > c.html_code, >left=[t.on(t.id==db.work.title_color), > c.on(c.id==db.work.cover_color)]) > > > > On Oct 12, 10:48 pm, Audra Rudys wrote: > > Please help! I'm trying to join using the

[web2py] need help on join with aliased tables

2010-10-12 Thread Audra Rudys
Please help! I'm trying to join using the same table twice, thus I need to do an alias. This is the first time I've ever tried an alias, so I don't know if I'm doing this right. If I were writing SQL code, I would write something like the following: SELECT db.work.*, db.tcolor.html_code, db.ccol

Re: [web2py] Re: using external authentication -- does web2py track users

2010-10-09 Thread Audra Rudys
I'll check that out, thanks! On Sat, Oct 9, 2010 at 3:09 PM, mdipierro wrote: > It should. visit > > http:///yourapp/appadmin > > you should find a auth_user record for every user and a auth_event for > every login. > > On Oct 9, 2:53 pm, Audra Rudys

[web2py] using external authentication -- does web2py track users

2010-10-09 Thread Audra Rudys
If I use external authentication (e.g., google or facebook), does web2py track "registered" users in any sense or current users (users that are logged in at any moment)? Or would I need to use the native authentication/registration if my app requires knowing who uses the app or who is currently us

[web2py] stop form from reposting with refresh

2010-09-27 Thread Audra Rudys
Hi all, I'm new to web2py and just dipping my toe in with a simple posting form (2 fields, a summary and description, displays form and the previously submitted values below -- date posted, summary, description.) I notice that after posting, my summary and description are cleared out in the form,