Edgewall Software

Changes between Initial Version and Version 1 of Ticket #11648


Ignore:
Timestamp:
Jun 14, 2014, 4:28:47 AM (10 years ago)
Author:
Ryan J Ollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11648

    • Property Owner set to Ryan J Ollos
    • Property Status newassigned
  • Ticket #11648 – Description

    initial v1  
    1 The `Changeset`, `Milestone` and `Node` classes have a `resource` property while the `Attachment`, `Ticket`, `Repository` and `WikiPage` classes create the `resource` attribute in their `__init__` method.
     1The `Changeset`, `Milestone` and `Node` classes have a `resource` read-only property while the `Attachment`, `Ticket`, `Repository` and `WikiPage` classes create the `resource` attribute in their `__init__` method.
    22
    3 Having `resource` as a property seems simpler since we don't have to worry about updating the `resource` attribute as the object changes. For example: [browser:/tags/trac-1.0.1/trac/ticket/model.py@:252#L236]. As a property, `resource` will be implicitly updated as the object changes.
     3Having `resource` as a read-only property seems simpler since we don't have to worry about updating the `resource` attribute as the object changes. For example: [browser:/tags/trac-1.0.1/trac/ticket/model.py@:252#L236]. As a read-only property, `resource` will be implicitly updated as the object changes.
    44
    55With this change and the one in #11609, if we ever find it worthwhile to create a `ModelBase` class it will be clear that `resource` and `realm` should be abstract properties (decorated with `abc.abstractproperty`). I also wanted to make this change ahead of modifying the `Component` and `Version` classes in #1233 so that the pattern to follow is clear.