Merge lp://staging/~ptressel/sahana-eden/devel into lp://staging/sahana-eden
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~ptressel/sahana-eden/devel |
Merge into: | lp://staging/sahana-eden |
Diff against target: |
709 lines (+444/-54) 4 files modified
controllers/hrm.py (+6/-0) models/06_hrm.py (+8/-1) modules/s3/s3crud.py (+174/-52) modules/s3/s3tools.py (+256/-1) |
To merge this branch: | bzr merge lp://staging/~ptressel/sahana-eden/devel |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
nursix (community) | Disapprove | ||
Fran Boon | Pending | ||
Review via email:
|
Description of the change
There are two example fields added to the hrm_human_resource list_fields, which makes those lines a bit long. So we might want to find someplace else to add fake virtual fields as an example.
Seems like having an official report_fields would be good -- people will likely want different (i.e. more) fields in reports than in list views.
I saw someone ask a question about naming conventions for globals -- is there an Official Change? Because there might be some violations of whatever the new rule is. There are several staticmethod functions in S3VirtualField that might be violations. And there's a method _get_field that could be shared -- I see the same sort of thing being done elsewhere. I gave get_list_fields a _ on front because it's really not appropriate for outside callers -- too non-general.
There are some ToDos. Main one is adding support for fake virtual fields in exporter.xls. If we add report_fields, and switch that over the exporter call to using report_fields, and don't put virtual fields in report_fields yet, we can kick the can down the road a bit.
Unmerged revisions
- 2266. By Pat Tressel
-
Merge from trunk.
- 2265. By Pat Tressel
-
Add fake virtual fields. For fk$fn for list_fields, allow records with empty fk if fk field isn't notnull.
Got questions? This doesn't really impact things that don't use the fake virtual fields, with one exception that's easy to fix, which is exporter.xls, to which support has not been added. If that is filtering fields that aren't in the table, then there's no effect. Otherwise, the quick way to avoid any interaction is to use report_fields for exporter.xls, and don't put any virtual fields in report_fields.
Here's one example use of a fake virtual field -- given population centers data, compute the population within a specified radius of some location. E.g. let the user pick the radius and set it in their session, then alter the gis_location list_fields to include that virtual field for a population centers query. This is (part of) a problem on the RHoK #3 list, proposed by Cat Graham, to go along with the previous population centers work.