Good day everyone!
Is this possible in Web2py?
View Students First Year (populate from the database)
- Section A (populate from the database)
- Section B and so on
- Section C
Second Year (populate from the database)
- Section A and so on
- Section B
- Section C
and so on
now to the code
myDB.py
db.define_table('stud_info',
Field('firstname'),
Field('lastname'))
db.define_table('section',
Field('section_name', requires=IS_NOT_EMPTY()))
db.define_table('yearstanding',
Field('year_level'),
Field('section', 'reference section'))
menu.py
response.menu = [(T('Home'), False, URL('icthome', 'home'), []),]
def _():
# shortcuts
app = request.application
ctr = request.controller
# useful links to internal and external resources
for row in db(db.year_standing).select():
response.menu += [
((T('View Students'), False, '#', [
((T(row.year_level), False, '#', [
(T(row.section), False, URL('',''), [])]))
]))
]
and I got error:
Traceback (most recent call last): <br><br>
File "D:\Kuya Files\My Videos\Tutorial\Python\web2py_win\gluon\restricted.py", line 227, in restricted
exec ccode in environment <br><br>
File "D:/Kuya Files/My Videos/Tutorial/Python/web2py_win/applications/ClearanceSystem/models/menu.py", line 168, in <module>
if DEVELOPMENT_MENU: _() <br><br>
File "D:/Kuya Files/My Videos/Tutorial/Python/web2py_win/applications/ClearanceSystem/models/menu.py", line 53, in _
for row in db(db.year_standing).select():<br><br>
File "D:\Kuya Files\My Videos\Tutorial\Python\web2py_win\gluon\packages\dal\pydal\base.py", line 906, in __getattr__
return super(DAL, self).__getattr__(key)<br><br>
File "D:\Kuya Files\My Videos\Tutorial\Python\web2py_win\gluon\packages\dal\pydal\helpers\classes.py", line 348, in __getattr__
raise AttributeError<br><br>
AttributeError