~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/interfaces/bugtask.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-10-03 15:22:48 UTC
  • mfrom: (8758.4.18 garbo-lockfile)
  • Revision ID: launchpad@pqm.canonical.com-20111003152248-cv30fo2i8p0mu5mb
[r=lifeless][bug=553254] Regularly prune LoginToken rows

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
    'BugTaskStatus',
18
18
    'BugTaskStatusSearch',
19
19
    'BugTaskStatusSearchDisplay',
20
 
    'DB_INCOMPLETE_BUGTASK_STATUSES',
21
 
    'DB_UNRESOLVED_BUGTASK_STATUSES',
22
20
    'DEFAULT_SEARCH_BUGTASK_STATUSES_FOR_DISPLAY',
23
21
    'IAddBugTaskForm',
24
22
    'IAddBugTaskWithProductCreationForm',
198
196
        this product or source package.
199
197
        """)
200
198
 
201
 
    # INCOMPLETE is never actually stored now: INCOMPLETE_WITH_RESPONSE and
202
 
    # INCOMPLETE_WITHOUT_RESPONSE are mapped to INCOMPLETE on read, and on
203
 
    # write INCOMPLETE is mapped to INCOMPLETE_WITHOUT_RESPONSE. This permits
204
 
    # An index on the INCOMPLETE_WITH*_RESPONSE queries that the webapp
205
 
    # generates.
206
199
    INCOMPLETE = DBItem(15, """
207
200
        Incomplete
208
201
 
276
269
        affected software.
277
270
        """)
278
271
 
 
272
    # DBItem values 35 and 40 are used by
 
273
    # BugTaskStatusSearch.INCOMPLETE_WITH_RESPONSE and
 
274
    # BugTaskStatusSearch.INCOMPLETE_WITHOUT_RESPONSE
 
275
 
279
276
    UNKNOWN = DBItem(999, """
280
277
        Unknown
281
278
 
290
287
    """
291
288
    use_template(BugTaskStatus, exclude=('UNKNOWN'))
292
289
 
293
 
    INCOMPLETE_WITH_RESPONSE = DBItem(13, """
 
290
    sort_order = (
 
291
        'NEW', 'INCOMPLETE_WITH_RESPONSE', 'INCOMPLETE_WITHOUT_RESPONSE',
 
292
        'INCOMPLETE', 'OPINION', 'INVALID', 'WONTFIX', 'EXPIRED',
 
293
        'CONFIRMED', 'TRIAGED', 'INPROGRESS', 'FIXCOMMITTED', 'FIXRELEASED')
 
294
 
 
295
    INCOMPLETE_WITH_RESPONSE = DBItem(35, """
294
296
        Incomplete (with response)
295
297
 
296
298
        This bug has new information since it was last marked
297
299
        as requiring a response.
298
300
        """)
299
301
 
300
 
    INCOMPLETE_WITHOUT_RESPONSE = DBItem(14, """
 
302
    INCOMPLETE_WITHOUT_RESPONSE = DBItem(40, """
301
303
        Incomplete (without response)
302
304
 
303
305
        This bug requires more information, but no additional
369
371
    BugTaskStatus.INPROGRESS,
370
372
    BugTaskStatus.FIXCOMMITTED)
371
373
 
372
 
# Actual values stored in the DB:
373
 
DB_INCOMPLETE_BUGTASK_STATUSES = (
374
 
    BugTaskStatusSearch.INCOMPLETE_WITH_RESPONSE,
375
 
    BugTaskStatusSearch.INCOMPLETE_WITHOUT_RESPONSE,
376
 
    )
377
 
 
378
 
DB_UNRESOLVED_BUGTASK_STATUSES = (
379
 
    UNRESOLVED_BUGTASK_STATUSES +
380
 
    DB_INCOMPLETE_BUGTASK_STATUSES
381
 
    )
382
 
 
383
374
RESOLVED_BUGTASK_STATUSES = (
384
375
    BugTaskStatus.FIXRELEASED,
385
376
    BugTaskStatus.OPINION,
490
481
    # bugwatch; this would be better described in a separate interface,
491
482
    # but adding a marker interface during initialization is expensive,
492
483
    # and adding it post-initialization is not trivial.
493
 
    # Note that status is a property because the model only exposes INCOMPLETE
494
 
    # but the DB stores INCOMPLETE_WITH_RESPONSE and
495
 
    # INCOMPLETE_WITHOUT_RESPONSE for query efficiency.
496
484
    status = exported(
497
485
        Choice(title=_('Status'), vocabulary=BugTaskStatus,
498
486
               default=BugTaskStatus.NEW, readonly=True))
499
 
    _status = Attribute('The actual status DB column used in queries.')
500
487
    importance = exported(
501
488
        Choice(title=_('Importance'), vocabulary=BugTaskImportance,
502
489
               default=BugTaskImportance.UNDECIDED, readonly=True))