If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    kroitus  14 years ago
    Hello. Sorry for maybe dumb question, but I have simple situation: Two tables something like that:
    db.define_table('category',
       Field('name'))
    
    db.define_table('expenses',
       Field('amount', 'double'),
       Field('id_category', db.category, required=False),
       Field('user'))
    
    I want to display expenses.amount and category.name in one table, but only from specific user. When I use db(db.expenses.id_category==db.category.id), I can easily display field category.name, but it displays records from all users. When I use db(db.expenses.id_users=='user'), it selects records from specific user, but it only displays expenses.id_category. Tried expenses.id_category.name - doesn't work.

Commented on:

This is a module that lets you build a table on the server that supports paging, sorting, editing and totals easily. It requires no javascript or sessions to work.

Hosting graciously provided by:
Python Anywhere