#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 |
||
Internal Changes: |
Description (last modified by )
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 , 11 years ago
Description: | modified (diff) |
---|---|
Summary: | Add realm attribute to Model and ResourceManager classes → Add realm attribute to Model classes |
comment:2 by , 11 years ago
Cc: | 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].
follow-up: 4 comment:3 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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].
follow-up: 5 comment:4 by , 11 years ago
Replying to rjollos:
Should we have a
model.py
module intrac/versioncontrol
forRepository
,Changeset
andNode
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.
comment:5 by , 11 years ago
comment:6 by , 11 years ago
API Changes: | modified (diff) |
---|
comment:7 by , 11 years ago
Keywords: | model added |
---|
Adding
realm
toIResourceManager
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 arealm
attribute, which is the first point that had me looking into this change.Proposed changes in log:rjollos.git:t11609.