[Schevo-devel] More field objects
Tom Locke
tom at livelogix.com
Mon Dec 19 04:38:39 EST 2005
Hi Folks,
>Let's take a specific example - readonly. All calculated fields are
>readonly. So that could live in the field_spec. All other fields are
>not readonly (in general). Now let's say you want to show the user a
>delete transaction and you want to display all the existing fields so
>they can see what it is they are potentially deleting. The delete
>transaction interates over all the fields it got by doing a call to
>thing.sys.fields() and sets the field to readonly = True.
>
>
To me, the idea of a read-only field on a transaction seems
non-sensical. The first time I saw the way schevo handles updates, I
assumed the transaction object was simply collecting a set of changes I
had made by assigning to its attributes. That set of changes could then
be applied to the database on db.execute(t). The fact that the
transaction object actually has a full set of field objects which can be
read or written, and can be made read-only etc., seems to me to be part
of the UI system and not the core database. If so, those features should
not be part of the core database api.
Can you give any example of using the core database where reading a
value from a transaction object would be useful, or where are read-only
transaction field would be useful?
>Or how about update transactions? Most updates would make all fields
>readonly = False. Right? The whole point is to allow changes. But
>what if you don't want to allow changes to one particular field once it
>has been set by a create txn?
>
When you say "you don't want to allow changes..." do you mean allow via
the UI, or allow via the python API? If it's a UI issue, I feel that
functionality should be in the UI layer. If it's a core API issue, then
it should go in the schema shouldn't it?
>By delegating responsibility in this fashion, the UI level gets to be
>pretty dumb. All it needs to do is look at the fields it is given.
>
That's a nice design, but not if that 'dumbness' has been achieved by
putting UI functionality in the core database.
Tom
More information about the Schevo-devel
mailing list