Hi Annet,
Thanks for getting back. However I got a ticket as below for my
code as shown below. I am but passing a simple query you suggested. Note ,
dayseven is = sevendays
*def view_demo():*
db.issues.id.readable=False
query = db(db.issues.date_today >= dayseven)
fields = (db.issues.ticket_no, db.issues.description,)
headers = {'issues.ticket_no': 'Ticket No' , 'issues.description':
'Description' }
default_sort_order = [db.issues.ticket_no ]
links = [
lambda row: A(SPAN(_class='icon
magnifier'),'View',_class='button', _title='View
Issue',_href=URL("default","view_cmgr",args=[row.id])),
lambda row: A(SPAN(_class='icon
downarrow'),'Edit',_class='button', _title='Edit
Issue',_href=URL("default","update_cmgr",args=[row.id])),
lambda row: A(SPAN(_class='icon
cross'),'Delete',_class='negative button', _title='Delete
Issue',_href=URL("default","delete_cmgr",args=[row.id])),
]
grid = SQLFORM.grid( query=query, fields=fields, headers=headers,
links=links, orderby=default_sort_order, user_signature=False, #details =
auth.has_permission('read', db.projects_posts),
create=False, deletable=False, details=False,
editable=False, csv=False, maxtextlength=64, paginate=15, ui='jquery-ui' )
return dict(grid = grid, counter = session.counter)
----
*Ticket ID*
127.0.0.1.2013-04-09.12-06-04.0cfff98e-43c5-4479-9849-e26ffe837d55
<type 'exceptions.IndexError'> list index out of rangeVersionweb2py™Version
2.4.5-stable+timestamp.2013.03.18.22.46.22PythonPython 2.7.2:
C:\Python27\python.exe (prefix: C:\Python27)Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Traceback (most recent call last):
File "D:\Web2py\web2py\gluon\restricted.py", line 212, in restricted
exec ccode in environment
File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py"
</admin/default/edit/BBOnline/controllers/default.py>, line 3961, in <module>
File "D:\Web2py\web2py\gluon\globals.py", line 194, in <lambda>
self._caller = lambda f: f()
File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py"
</admin/default/edit/BBOnline/controllers/default.py>, line 808, in
view_tickets_pa
create=False, deletable=False, details=False, editable=False, csv=False,
maxtextlength=64, paginate=15, ui='jquery-ui' )
File "D:\Web2py\web2py\gluon\sqlhtml.py", line 1885, in grid
field_id = tables[0]._id
IndexError: list index out of range
Rahul
On Tuesday, April 9, 2013 11:27:26 AM UTC+5:30, Annet wrote:
>
> Hi Rahul,
>
> > Of course, you could omit the db.issues.date_today <= request.now if you
> know for a fact there are no time travelers opening tickets in the future.
>
> :-)
>
> What Derek means, if db.issues.date_today is the date the issues was
> created, than you can leave db.issues.date_today <= today out, because
> there won't be any issues in the database where db.issues.date_today > today
>
> > You are passing rows/records where you are supposed to pass a query.
>
> What Massimo means, you should pass db(db.issues.date_today >= sevendays)
> so, without .select()
>
>
> I hope these remarks help you solve the issue.
>
> Annet
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.