1
# Copyright 2009 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
10
from storm.locals import (
15
from zope.interface import implements
17
from canonical.launchpad.interfaces.lpstorm import IMasterStore
18
from lp.soyuz.interfaces.binarypackagepath import IBinaryPackagePath
21
class BinaryPackagePath(Storm):
22
"""See `IBinaryPackagePath`."""
23
implements(IBinaryPackagePath)
24
__storm_table__ = 'BinaryPackagePath'
25
id = Int(primary=True)
26
path = RawStr(name='path', allow_none=False)
28
def getOrCreate(self, path):
29
"""See `IBinaryPackagePathSet`."""
30
store = IMasterStore(BinaryPackagePath)
32
BinaryPackagePath, BinaryPackagePath.path == path).one()
34
bpp = BinaryPackagePath()