I've tried with

db.auth_user.owner_proj.default = db.(db.auth_user.id ==
reques.args[0]).select(db.auth_user.owner_proj).first()

form = crud.update(db.auth_user, request.args[0])

but nothing happens, I mean, the form shows filled OK except in the 3
multiple fields which appears to be empty, I can edit and save, but I can't
see the default, am I doing something wrong?

On Wed, Aug 3, 2011 at 12:35 PM, Ismael Serratos <[email protected]>wrote:

> Hii! How could I pre populate a crud.update (or equivalent with SQLFORM), I
> mean, I have 3 list:string multiple fields (they take the value from another
> table), like this
>
> db.define_table('project',
>                 Field('name','string'),
>                 Field('comment','text'),format='%(name)s')
> db.define_table(
>     auth.settings.table_user_name,
>     Field('first_name', length=128, default=''),
>     Field('last_name', length=128, default=''),
>     Field('username', length=128, default='', unique=True),
>     Field('email','string'),
>     Field('prefered_project',db.project,requires=IS_IN_DB(db,db.project.id
> ,"%(name)s")),
>     Field('user_proj','string',requires=IS_IN_DB(db,db.project.id
> ,"%(name)s",multiple=True)),
>     Field('owner_proj','string',requires=IS_IN_DB(db,db.project.id,"%(name)s",
> multiple=True)),
>     Field('reader_proj','string',requires=IS_IN_DB(db,db.project.id
> ,"%(name)s",multiple=True)),
>     Field('password', 'password', length=512,
>           readable=False, label='Password'),
>     Field('registration_key', length=512,
>           writable=False, readable=False, default=''),
>     Field('reset_password_key', length=512,
>           writable=False, readable=False, default=''),
>     Field('registration_id', length=512,
>           writable=False, readable=False, default=''))
>
>
> So I have a controller where a super user can modify user_proj, owner_proj
> and reader_proj, but when I get into the controller the already saved values
> in those fields doesn't appear populated, and I if save it without changes
> it erases the values.
>
>
>
>
>
>
>
>

Reply via email to