Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#11609 closed enhancement (fixed)

Add realm attribute to Model classes

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.2
Component: general Version:
Severity: normal Keywords: model
Cc: Jun Omae Branch:
Release Notes:
API Changes:

Added realm attribute to model classes: Attachment, Milestone, Repository, Changeset, Node, Ticket and WikiPage.

Internal Changes:

Description (last modified by Ryan J Ollos)

The proposed change is a refactoring to add a realm attribute to Model and ResourceManager classes. In some cases, the attribute already exists: tags/trac-1.0.1/trac/wiki/model.py?marks=33#L30.

Previously discussed in th:comment:8:ticket:11706.

Attachments (0)

Change History (7)

comment:1 by Ryan J Ollos, 11 years ago

Description: modified (diff)
Summary: Add realm attribute to Model and ResourceManager classesAdd realm attribute to Model classes

Adding realm to IResourceManager classes doesn't seem to make sense given that they can be associated with multiple realms: tags/trac-1.0.1/trac/versioncontrol/api.py@:367-369#L364.

However the change for model classes probably makes sense. In Bloodhound there is a ModelBase class with a realm attribute, which is the first point that had me looking into this change.

Proposed changes in log:rjollos.git:t11609.

comment:2 by Jun Omae, 11 years ago

Cc: Jun Omae added

Looks good to me. I think we could also add the same attribute to Attachment, Repository, Changeset and Node models. See [0a45ce96/jomae.git].

comment:3 by Ryan J Ollos, 11 years ago

Resolution: fixed
Status: newclosed

Thanks for the additional changes. Component and Version in trac/ticket/model.py will probably have a realm attribute added when #1233 is implemented.

Should we have a model.py module in trac/versioncontrol for Repository, Changeset and Node models? That might give us a more consistent structuring of the modules.

Committed to trunk in [12776].

in reply to:  3 ; comment:4 by Jun Omae, 11 years ago

Replying to rjollos:

Should we have a model.py module in trac/versioncontrol for Repository, Changeset and Node models? That might give us a more consistent structuring of the modules.

Agreed. If these models are moved to model.py, I think we should add from trac.versioncontrol.model import Repository, Changeset, Node in api.py for backward compatibilities.

in reply to:  4 comment:5 by Ryan J Ollos, 11 years ago

Replying to jomae:

Agreed. If these models are moved to model.py, I think we should add from trac.versioncontrol.model import Repository, Changeset, Node in api.py for backward compatibilities.

Thanks. I'll make the changes in #11610.

comment:6 by Ryan J Ollos, 11 years ago

API Changes: modified (diff)

comment:7 by Ryan J Ollos, 10 years ago

Keywords: model added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.