~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/packagesetsources.py

  • Committer: Jeroen Vermeulen
  • Date: 2011-06-21 05:30:19 UTC
  • mto: This revision was merged to the branch mainline in revision 13280.
  • Revision ID: jeroen.vermeulen@canonical.com-20110621053019-pqm4t7hotawtmw0c
Clean up queue view and tests a bit, preload more data.

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
"""The `PackagesetSources` linking table.
 
5
 
 
6
This table associates `Packageset`s with `SourcePackageName`s.
 
7
"""
 
8
 
 
9
__metaclass__ = type
 
10
__all__ = [
 
11
    'PackagesetSources',
 
12
    ]
 
13
 
 
14
from storm.locals import (
 
15
    Int,
 
16
    Reference,
 
17
    Storm,
 
18
    )
 
19
 
 
20
 
 
21
class PackagesetSources(Storm):
 
22
    """Linking table: which packages are in a package set?"""
 
23
    # This table is largely managed from Packageset, but also directly
 
24
    # accessed from other places.
 
25
 
 
26
    __storm_table__ = 'PackagesetSources'
 
27
 
 
28
    # There's a vestigial id as well, a holdover from the SQLObject
 
29
    # days.  Nobody seems to use it.  The only key that matters is
 
30
    # (packageset, sourcepackagename).
 
31
    __storm_primary__ = (
 
32
        'packageset_id',
 
33
        'sourcepackagename_id',
 
34
        )
 
35
 
 
36
    packageset_id = Int(name='packageset')
 
37
    packageset = Reference(packageset_id, 'Packageset.id')
 
38
    sourcepackagename_id = Int(name='sourcepackagename')
 
39
    sourcepackagename = Reference(
 
40
        sourcepackagename_id, 'SourcePackageName.id')