Some more info. For the example below

http://domain.com/app/default/index/table                       # all
records for table
http://domain.com/app/default/index/table?keywords=...   # all records
for table that match search
http://domain.com/app/default/index/table.field/value       # all
records for table.field==value
http://domain.com/app/default/index/table/create/table    # create
record form (*)
http://domain.com/app/default/index/table/view/table/id    # view
record (*)
http://domain.com/app/default/index/table/edit/table/id    # edit
record (*)
http://domain.com/app/default/index/table/delete/table/id    # dete
record (*)

(*) must be signed URLS
here "table" is a table name and "field" is a fieldname
Everythingis linked with everything automatically. You can add
buttons.
All lables are from table.field.label

\
On Aug 19, 4:50 am, Massimo Di Pierro <[email protected]>
wrote:
> Now you can also do this (complete program):
>
> # model
> db=DAL()
> from gluon.tools import Auth
> auth=Auth(db)
> auth.define_tables()
> db.define_table('person',Field('name'))
> db.define_table('dog',Field('name'),Field('image','upload'),Field('owner',d 
> b.person))
> if db(db.person).isempty():
>     from gluon.contrib.populate import populate
>     populate(db.person,300)
>     populate(db.dog,300)
>     db.commit()
>
> # controller
> @auth.requires_login()
> def index():
>     form=SQLFORM.demo(db.person)  #<<<<<
>     return dict(form=form)
>
> #<<<< will blow your mind!
>
> It is like SQLFORM.grid but also deals with representation of
> references. The source code is simple.

Reply via email to