Ticket #59 (closed implementation: fixed)

Opened 1 year ago

Last modified 1 year ago

Allow relabeling of labeled objects

Reported by: mscott Assigned to: mscott
Priority: normal Milestone: Schevo 3.1a1
Component: Schevo Keywords:
Cc:

Description

When you customize a canonical transaction using a t method, you cannot change the label of the transaction in a straightforward way.

For example, in this schema, if you have a Foo entity f1, then the label for the transaction method f1.t.custom_update is "Custom Update". However, the label for the transaction returned by that transaction method will just be "Update":

class Foo(E.Entity):
    name = f.unicode()
    age = f.integer()
    def t_custom_update(self):
        tx = self.t.update()
        tx.f.name.readonly = True
        return tx

By implementing a relabel function (available globally in a database schema, and defined in the schevo.label module) we can relabel the transaction before we return it:

class Foo(E.Entity):
    name = f.unicode()
    age = f.integer()
    def t_custom_update(self):
        tx = self.t.update()
        tx.f.name.readonly = True
        relabel(tx, 'Custom Update')
        return tx

Change History

07/29/07 23:01:14 changed by mscott

  • owner set to mscott.
  • status changed from new to assigned.

as of r3403, relabel is implemented, and docs about labeling are substantially improved. merging...

07/29/07 23:18:18 changed by mscott

merged to trunk at r3404

keeping open since we'll probably add more docs

08/09/07 20:34:39 changed by mscott

  • status changed from assigned to closed.
  • resolution set to fixed.

closed

open new ticket for docs