3
An OOPS infestation is a group of OOPSes with the same exception type and
4
exception value, linked to a Launchpad bug report.
6
Let's load OOPSes into the database.
8
>>> from oopstools.oops.helpers import load_database
9
>>> from datetime import date, timedelta
10
>>> start_date = date(2007, 01, 01)
11
>>> load_database(start_date)
12
'Oopses loaded into the database.'
16
Oops infestations have a convenient method to retrieve the latest oops with the
19
>>> from oopstools.oops.models import Oops
20
>>> oops = Oops.objects.get(oopsid__exact='OOPS-689S4')
21
>>> oops.oopsinfestation.last_seen_oops
24
== Frequency report ==
26
Oops infestations have a convenient method to retrieve how many oopses have
27
happened in the past 7 days with the same infestation.
29
>>> from oopstools.oops import helpers
30
>>> helpers._today = date(2010, 1, 23)
31
>>> oops = Oops.objects.get(oopsid__exact='OOPS-689S4')
32
>>> oops.oopsinfestation.past_week_count
35
= Reset the database =
37
>>> from oopstools.oops.helpers import reset_database
39
'Oops, DBOopsRootDirectory and Infestation deleted.'