Changes between Version 6 and Version 7 of DeveloperGuidelines


Ignore:
Timestamp:
12/20/08 04:38:25 (14 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines

    v6 v7  
    3838We extend the T2 class in modules/sahana.py
    3939
    40 CRUD
    41 Create Record:
    42   Controller
    43 {{{
    44    def add_record():
    45        form=t2.create(db.table)
    46        return dict(form=form)
    47 }}}
    48   View
    49     views/module/add_record.html
    50 {{{
    51      {{=form}}
    52 }}}
    53 Display Record:
    54   Controller
    55 {{{
    56    def display_record():
    57        item=t2.display(db.table)
    58        return dict(item=item)
    59 }}}
    60   View
    61     views/module/display_record.html
    62 {{{
    63      {{=item}}
    64 }}}
    65 Update Record:
    66   Controller
    67 {{{
    68    def display_record():
    69        form=t2.update(db.table)
    70        return dict(form=form)
    71 }}}
    72   View
    73     views/module/add_record.html
    74 {{{
    75      {{=form}}
    76 }}}
    77 Delete Record:
    78   Controller
    79 {{{
    80    def delete_record():
    81    db(db.table.id==t2.id).delete()
    82    response.confirmation=T("Record deleted")
    83    response.view="module/list_records.html"
    84 }}}
    85   View
    86     normally not used (reuse existing list_records view)
    87 
     40DeveloperGuidelinesCreateReadUpdateDelete
    8841
    8942Populate the side navigation Menus by adding this to each controller: