Computed Columns on client view

Now that we have model classes, we can add properties to those classes for attributes that are ‘computed on the fly’.

Could we have the ability to include those properties as columns in client views?

The idea is to have something similar to a computed column in a conventional SQL view.

2 Likes

If I understand correctly, you want to be able to read the computed field value using the notation row['name_of_computed_field'] as well as row.name_of_computed_field, but writes (via either notation) would be disallowed. Is that correct?

Writes would depend on:

  1. Whether it’s a client writable view or not
  2. Whether you’ve defined a setter for the property

In your model, what does it mean to write to a computed column?

It would be no different to setting a property value - it would call the setter for that property on the relevant instance.