Now I am even more confused :)
Sorry for being a nagging person.
Why does SQLFORM.grid display the name (as I want) in the setupid
column, but not display the name on Size ID or hostgroup. ?
Id
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage?keywords=&order=lvstorage.id&_signature=8dbb920c257181ac6fc35485619f4345c246c296>
Setup ID
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage?keywords=&order=lvstorage.setup_id&_signature=a0a4d78cba448c29fc27a1706b56da0f45ccfba2>
Size ID
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage?keywords=&order=lvstorage.lvsize_id&_signature=95b25e5d3ea2df3c36319851611869e9185708aa>
Lun ID
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage?keywords=&order=lvstorage.lunid&_signature=7153b8a143e74e602bda43f31123a9606e21e24f>
Host Group
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage?keywords=&order=lvstorage.storagemap_id&_signature=eeb802acefa7a18bbd87fbda8f3d690578769d7e>
1
AN10 on frame 520-1
2
2
7
View
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage/view/lvstorage/1?_signature=145034e485ba2811bdd12f874e26cfe9144ce779>Edit
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage/edit/lvstorage/1?_signature=8de6c80354940b970b0af5f4c88e7a2f3e8f838c>Delete
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage#null>
2
AN10 on frame 520-1
2
3
7
View
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage/view/lvstorage/2?_signature=21b8a4286ba02217a3a4685bab985290e5eb0ec1>Edit
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage/edit/lvstorage/2?_signature=557572282c31c0a17c8a03e3c896198365771626>Delete
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage#null>
3
AN10 on frame 520-1
2
4
7
View
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage/view/lvstorage/3?_signature=17f856570c5acbb1b3513479589e6c64215e38fc>Edit
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage/edit/lvstorage/3?_signature=d9871efc593f5ad4525ed3f290e92a7a7d150dc4>Delete
<http://127.0.0.1:8000/adeploy/formdb/modify_lvstorage#null>
The database table
db.define_table('lvstorage',
Field('setup_id', db.setup,
default=1,
label=T('Setup ID')),
Field('lvsize_id', db.lvsize,
default=2,
label=T('Size ID')),
Field('lunid', type='integer',
default=2,
label=T('Lun ID')),
Field('storagemap_id', db.storagemap,
default=1,
label=T('Host Group')),
Field('created_on','datetime',default=request.now,
label=T('Created On'),writable=False,readable=False),
Field('modified_on','datetime',default=request.now,
label=T('Modified On'),writable=False,readable=False,
update=request.now),
migrate=settings.migrate)
# Table rules
db.lvstorage.setup_id.requires = IS_IN_DB(db, 'setup.id',
'setup.setupname')
db.lvstorage.lvsize_id.requires = IS_IN_DB(db, 'lvsize.id',
'lvsize.sizename')
db.lvstorage.storagemap_id.requires = IS_IN_DB(db, 'storagemap.id',
'storagemap.mapping')
Controller
left =
(db.lvsize.on(db.lvstorage.lvsize_id==db.lvsize.id),db.storagemap.on(db.lvstorage.storagemap_id==db.storagemap.id),db.setup.on(db.lvstorage.setup_id==db.setup.id))
query = db.lvstorage.setup_id==usedsetupid
grid = SQLFORM.grid(query,
left = left,
csv = False
)
return dict(usedsetupid=usedsetupid, grid=grid)
> Now I think of it, you do not need to do a redirect because it
creates its
> own page based on the called page.
>
> Its just that the submit does not do anything.
>
> > SQLFORM.grid does not actually add the records automatically. It just
> > calls the grid controller with args action/table.
> >
> > You have to do something like:
> > if request.args(0) in ("edit", "new"):
> > redirect(URL("edit.html", args=[request.args(1),
> >
> > request.args(2)])
> >
> > On Nov 2, 9:15 am, Mike Veltman <mike.velt...@gmail.com> wrote:
> > > > are you able to see the form? or are you getting the "not
authorized
> > > > message?"
> > > >
> > > > you can set user_signature=False or ensure that user is logged in.
> > >
> > > Thanks for the reaction. But no the form is generated perfectly. And
> > > the user is logged in.
> > >
> > > > On Wed, Nov 2, 2011 at 6:50 AM, Mike Veltman
<mike.velt...@gmail.com>
>
> wrote:
> > > > > I have
> > > > > grid =
> > > > >
> > > > >
SQLFORM.grid(query=db.lvstorage.setup_id==usedsetupid,csv=False,det
> > > > > ai ls=T rue,searchable=True)
> > > > >
> > > > > That creates a form with the records with a add button. But
when I
> > > > > use add I
> > > > > get the next screen but the record is not added. What do I
miss ?
> > > > >
> > > > > Btw is the same setup with a query possible with
SQLFORM.smartgrid
> > > > > ?
> > > > >
> > > > > With regards,
> > > > > Mike Veltman
> > >
> > > With regards,
> > > Mike Veltman
>
> With regards,
> Mike Veltman
With regards,
Mike Veltman