Changes between Version 35 and Version 36 of GenericTrac
- Timestamp:
- Aug 3, 2010, 7:45:56 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenericTrac
v35 v36 221 221 == Possible Implementation Plan == 222 222 223 === Milestone First === 223 === Base 224 225 The model is relatively simple to implement. 226 227 There will be a few generic utility functions for creating a set tables for the "generic scheme", and one for versioned resource: 228 {{{ 229 #!python 230 def create_resource_tables(env, resource): 231 """Create resource_prop, _prop_string and _prop_text tables.""" 232 ... 233 234 def create_versioned_resource_tables(env, resource): 235 """Create a generic scheme for resource plus related ancillary 236 versioning resource (_rev and _version)""" 237 with env.db_transaction(): 238 for r in (resource, 239 resource + "_rev", 240 resource + "_version"): 241 create_generic_scheme(r) 242 }}} 243 244 On the model level, we could create a few utility classes: 245 - a "view" (read-only dictionary), which will contain the current values 246 for an instance (i.e. all the records within `{resource}_prop...` 247 tables with the same `id`) 248 - an "abstractmodel", object wrapping a view 249 (for keeping around the "old" values), but mutable 250 - "model", concrete subclass of the above, which implements loading 251 by fetching the data from a set of tables following the generic scheme 252 253 Note that `view`s could eventually be cached, somehow (need to think carefully about how to do cross-process invalidation, though; there's certainly a way on top of the CacheManager). 254 255 === Applied on Milestone module === 224 256 - modify the Milestone module so that it uses the new proposed datamodel. 225 257 - experiment new tabbed view for the milestone (''View'', ''Discussion'', ''History''). See TracProject/UiGuidelines. … … 230 262 Once this is complete, validate the genericity by promoting the components to be first class resources as well (#1233). 231 263 232 === Ticket First===264 === Applied on Ticket module === 233 265 234 266 As the ticket module is by far the most complex, it might be worth to … … 241 273 custom fields, queries, etc.) to other resources (milestone, wiki, component, ...) 242 274 243 === Wiki First===275 === Applied on Wiki module === 244 276 245 277 Milestone and components are closer in spirit to a wiki page than to a ticket (we have the long standing #3776 ticket). … … 249 281 If we do this, we can also at the same time think about the storage model, in particular how past versions could be stored in a VCS (#1132). We could then think about a serialization model that would play nicely with the genericity of the Trac resources on one hand side, and with the external editors on the other hand. 250 282 251 === Component First===283 === Applied on Component module === 252 284 253 285 An other possibility would be to start on fresh ground, implementing not yet existing resource typse in a generic way. That would be the less disrupting approach, as everything else should just continue to work unchanged (or mostly unchanged, except for things like #5211 and places where we deal with the old `component` table).