~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/interfaces/oopsreferences.py

  • Committer: Stuart Bishop
  • Date: 2011-11-14 07:51:26 UTC
  • mfrom: (14291 devel)
  • mto: This revision was merged to the branch mainline in revision 14299.
  • Revision ID: stuart.bishop@canonical.com-20111114075126-8jhoq57i2qphmch1
Merged rocketfuel into trivial.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2011 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""Interfaces for querying OOPS references."""
 
5
 
 
6
__metaclass__ = type
 
7
 
 
8
__all__ = [
 
9
    'IHasOOPSReferences',
 
10
    ]
 
11
 
 
12
 
 
13
from lazr.restful.declarations import (
 
14
    export_read_operation,
 
15
    operation_for_version,
 
16
    operation_parameters,
 
17
    )
 
18
from zope.interface import (
 
19
    Interface,
 
20
    )
 
21
from zope.schema import (
 
22
    Datetime
 
23
    )
 
24
 
 
25
from canonical.launchpad import _
 
26
 
 
27
 
 
28
class IHasOOPSReferences(Interface):
 
29
    """Has references to OOPSes that can be queried."""
 
30
 
 
31
    @operation_parameters(
 
32
        start_date=Datetime(title=_("Modified after date")),
 
33
        end_date=Datetime(title=_("Modified before date")),
 
34
        )
 
35
    @export_read_operation()
 
36
    @operation_for_version('devel')
 
37
    def findReferencedOOPS(start_date, end_date):
 
38
        """Find OOPS reports between start_date and end_date.
 
39
 
 
40
        :param start_date: Do not look in objects whose last modification time
 
41
            is before this date.
 
42
        :param end_date: Do not look in objects whose last modification time
 
43
            is after this date.
 
44
        :return: A set of OOPS id's - strings of the form 'OOPS-\w+'.
 
45
        """