py4web virtual fields not included when rows retrieved

Open
#784 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
database

Research direction

Start by reproducing the documented db(db.item).select() virtual-field example in py4web and confirm that row.total_price is absent. Compare the behavior with web2py and pyDAL, as described in the issue. Done means selected rows include computed virtual fields consistently with the documented behavior.

Written by the indexing model from the issue text.

Description

The documentation says:

A virtual field defined as the one above is automatically computed for all records when the records are selected:

for row in db(db.item).select():
print(row.total_price)

However, this is not happening. Virtual fields are not included in the selected rows. Works as documented in web2py, which is curious as both use pyDAL.

see https://groups.google.com/g/py4web/c/vHvUoXW4fh8/m/-Omdzbi0CQAJ

Dominant language
HTML
Stars
319
Forks
144
Avg merge
6d 20h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web2py/py4web

All issues in web2py/py4web

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.