links = [dict(header='View', body=GetCartsGridLink)]
def GetCartsGridLink(row):
id = None
try:
id = row.cart.id # this works for the grid itself
except:
id = row.id # this works for the view/edit of a record of the grid
result = A(id,
_href=URL('manage', 'view_cart', args=id, user_signature=True),
_target='blank')
return result
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/UGhYBMwmXec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/257aa85d-41f2-4b2e-a59a-bd1980c83efco%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CABZ%2BKCCVY37AMAFQ6FxgpJvX3X%3Dbr9gFBU68c74HpUJw3pEa%2BQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAERBpoBS7skdN8q%3DzYwfA01WK-TKEHXkvq0iX%3Df4ghMRVbPzyw%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/257aa85d-41f2-4b2e-a59a-bd1980c83efco%40googlegroups.com.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/UGhYBMwmXec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CABZ%2BKCCVY37AMAFQ6FxgpJvX3X%3Dbr9gFBU68c74HpUJw3pEa%2BQ%40mail.gmail.com.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/UGhYBMwmXec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/ffccc9ca-dc13-4efe-a6f3-d4140576053co%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CABZ%2BKCAAXA1tmt8gt3%2BDnJiwQFy28%3DLMag5YA9ra1rX0k52TSA%40mail.gmail.com.
def show_carts():
query = db.cart
headers = {'cart.id':'ID', 'cart.description':'Name', 'cart_ownership.boss':'Owner', 'cart_ownership.status':'Status', 'cart.count':'Items'}
fields = [db.cart.id, db.cart.description, db.cart_ownership.boss, db.cart_ownership.status, db.cart.count]
links = [dict(header='View', body=GetCartsGridLink)]
grid = SQLFORM.grid(query,
editable=True,
details=True,
create=True,
links=links,
fields=fields,
headers=headers,
orderby=[~db.cart.created_on],
left = [db.cart_ownership.on(db.cart.id==db.cart_ownership.cart)],
formname='carts_grid',
field_id=db.cart.id,
)
return grid
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAERBpoCUMsMOm47LJOFgs5V%3DoWOx6LCngXCUNA0D9J10aWDQYQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/ffccc9ca-dc13-4efe-a6f3-d4140576053co%40googlegroups.com.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/UGhYBMwmXec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CABZ%2BKCAAXA1tmt8gt3%2BDnJiwQFy28%3DLMag5YA9ra1rX0k52TSA%40mail.gmail.com.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/UGhYBMwmXec/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAERBpoCUMsMOm47LJOFgs5V%3DoWOx6LCngXCUNA0D9J10aWDQYQ%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/6b303bc0-a860-4d9d-8b00-c1277f6dbeb1o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/6b303bc0-a860-4d9d-8b00-c1277f6dbeb1o%40googlegroups.com.