You can set those in your controller dynamically.

for example

def admin_edit():
      db.tablename.fieldname.writable = True
      db.tablename.fieldname.readable = True

      return dict(form=crud(db.tablename))

def normal_edit():
      db.tablename.fieldname.writable = False
      db.tablename.fieldname.readable = False

      return dict(form=crud(db.tablename))

-Thadeus




On Thu, Oct 8, 2009 at 10:47 AM, Peter Woolf <pwo...@gmail.com> wrote:

>
> This could work, but this solution is more permanent than I want.
> I'd like to make it so that I could dynamically select the fields I
> want to edit.  I know I can do it with SQLform but without all of the
> nice features that crud provides.
>
> Other thoughts?
> thanks!
> --Peter
>
>
> On Oct 8, 11:30 am, Thadeus Burgess <thade...@thadeusb.com> wrote:
> > Try setting the fields that you do not want edited with their
> > writable=False. Then using the basic {{=form}} syntax.
> >
> > db.tablename.fieldname.writable = False
> > db.tablename.fieldname.readable = False
> >
> > -Thadeus
> >
> >
> >
> > On Thu, Oct 8, 2009 at 10:21 AM, Peter Woolf <pwo...@gmail.com> wrote:
> > > Hello,I'm very pleased with how helpful crud is, but am having some
> > > problems with the custom forms.  I have a table with multiple fields,
> but I
> > > want to use a custom crud form to just change *one* field in this form.
> > > When I try to do this with =form.custom.widget the database does not
> update.
> > >  The only way I can get it to update is to let the user change *all* of
> the
> > > fields.  I've made up a small example (attached) to display this.  If I
> > > change the person's name, it does not work, but if I add in to the view
> the
> > > line
> > > {{=form.custom.widget.age}}
> > > then the database will be updated.  Any thoughts on a workaround?  Am I
> > > doing something wrong or is this a bug?
> >
> > > Thanks,
> > > --Peter
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to