Edgewall Software
Modify

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#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 Ryan J Ollos)

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:1 by Ryan J Ollos, 10 years ago

I created this ticket because I wanted to look at this ahead of changes to Component and Version models in #1233.

Last edited 10 years ago by Ryan J Ollos (previous) (diff)

comment:2 by Ryan J Ollos, 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 Ryan J Ollos, 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 lkraav <leho@…>, 10 years ago

Cc: leho@… added

comment:5 by Ryan J Ollos, 9 years ago

Owner: Ryan J Ollos removed

comment:6 by Ryan J Ollos, 9 years ago

Description: modified (diff)

comment:7 by Ryan J Ollos, 9 years ago

Resolution: wontfix
Status: newclosed

I've added some text to TracDev/ScratchPad/DataModels@2. Closing this for now as wontfix.

comment:8 by Ryan J Ollos, 9 years ago

Milestone: next-major-releases

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) 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.