#11701 closed enhancement (wontfix)
Abstract base class for Model classes
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | model |
Cc: | leho@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
An abstract base class for model classes is proposed for discussion. This was previously mentioned in #11609 and #11648. At a minimum we can discuss the challenges in making the API consistent for Model classes and perhaps improve some minor issues, even if we don't end up implementing an abstract base class.
Attachments (0)
Change History (8)
comment:2 by , 10 years ago
One API inconsistency we may want to fix is the return value from select
class methods. In most cases a generator is returned, but there are cases of a list being returned:
I suppose the difference is that the two method with return
sort the list, but it seem ideal to always return a generator for consistency.
comment:3 by , 10 years ago
The Bloodhound ModelBase
class (mentioned in comment:1:ticket:11609, [bh:browser:/trunk/bloodhound_dashboard/bhdashboard/model.py@1570461:44#L44]), has some useful aspects that we may want to adopt. For example, one obstacle to having a common signature for the select
method for all the model classes is the include_completed parameter of Milestone
class (though there are many other obstacles as well, and going too far down this path might just lead to the changes suggested by GenericTrac). The include_completed
and similar parameters would be handled more generally by ModelBase
with where
, limit
and order_by
parameters: [bh:browser:/trunk/bloodhound_dashboard/bhdashboard/model.py?rev=1570461&marks=250#L249].
comment:4 by , 10 years ago
Cc: | added |
---|
comment:5 by , 10 years ago
Owner: | removed |
---|
comment:6 by , 9 years ago
Description: | modified (diff) |
---|
comment:7 by , 9 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I've added some text to TracDev/ScratchPad/DataModels@2. Closing this for now as wontfix.
comment:8 by , 9 years ago
Milestone: | next-major-releases |
---|
I created this ticket because I wanted to look at this ahead of changes to Component and Version models in #1233.