Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
64f216c0
D
Dak
项目概览
喜羊羊3508
/
Dak
10 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
64f216c0
编写于
10月 28, 2009
作者:
M
Mark Hymers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add basic mapper classes for new tables
Signed-off-by:
N
Mark Hymers
<
mhy@debian.org
>
上级
db5f28a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
48 addition
and
0 deletion
+48
-0
daklib/dbconn.py
daklib/dbconn.py
+48
-0
未找到文件。
daklib/dbconn.py
浏览文件 @
64f216c0
...
...
@@ -377,6 +377,22 @@ __all__.append('get_binary_components')
################################################################################
class
BinaryACL
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
__all__
.
append
(
'BinaryACL'
)
################################################################################
class
BinaryACLMap
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
__all__
.
append
(
'BinaryACLMap'
)
################################################################################
class
Component
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
...
...
@@ -1770,6 +1786,14 @@ __all__.append('get_source_in_suite')
################################################################################
class
SourceACL
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
__all__
.
append
(
'SourceACL'
)
################################################################################
class
SrcAssociation
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
...
...
@@ -2089,6 +2113,14 @@ __all__.append('get_uid_from_fingerprint')
################################################################################
class
UploadBlock
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
__all__
.
append
(
'UploadBlock'
)
################################################################################
class
DBConn
(
Singleton
):
"""
database module init.
...
...
@@ -2107,6 +2139,8 @@ class DBConn(Singleton):
self
.
tbl_archive
=
Table
(
'archive'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_bin_associations
=
Table
(
'bin_associations'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_binaries
=
Table
(
'binaries'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_binary_acl
=
Table
(
'binary_acl'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_binary_acl_map
=
Table
(
'binary_acl_map'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_component
=
Table
(
'component'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_config
=
Table
(
'config'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_content_associations
=
Table
(
'content_associations'
,
self
.
db_meta
,
autoload
=
True
)
...
...
@@ -2127,6 +2161,7 @@ class DBConn(Singleton):
self
.
tbl_queue_build
=
Table
(
'queue_build'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_section
=
Table
(
'section'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_source
=
Table
(
'source'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_source_acl
=
Table
(
'source_acl'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_src_associations
=
Table
(
'src_associations'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_src_format
=
Table
(
'src_format'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_src_uploaders
=
Table
(
'src_uploaders'
,
self
.
db_meta
,
autoload
=
True
)
...
...
@@ -2134,6 +2169,7 @@ class DBConn(Singleton):
self
.
tbl_suite_architectures
=
Table
(
'suite_architectures'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_suite_src_formats
=
Table
(
'suite_src_formats'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_uid
=
Table
(
'uid'
,
self
.
db_meta
,
autoload
=
True
)
self
.
tbl_upload_blocks
=
Table
(
'upload_blocks'
,
self
.
db_meta
,
autoload
=
True
)
def
__setupmappers
(
self
):
mapper
(
Architecture
,
self
.
tbl_architecture
,
...
...
@@ -2169,6 +2205,12 @@ class DBConn(Singleton):
binassociations
=
relation
(
BinAssociation
,
primaryjoin
=
(
self
.
tbl_binaries
.
c
.
id
==
self
.
tbl_bin_associations
.
c
.
bin
))))
mapper
(
BinaryACL
,
self
.
tbl_binary_acl
,
properties
=
dict
(
binary_acl_id
=
self
.
tbl_binary_acl
.
c
.
id
))
mapper
(
BinaryACLMap
,
self
.
tbl_binary_acl_map
,
properties
=
dict
(
binary_acl_map_id
=
self
.
tbl_binary_acl_map
.
c
.
id
))
mapper
(
Component
,
self
.
tbl_component
,
properties
=
dict
(
component_id
=
self
.
tbl_component
.
c
.
id
,
component_name
=
self
.
tbl_component
.
c
.
name
))
...
...
@@ -2287,6 +2329,9 @@ class DBConn(Singleton):
srcassociations
=
relation
(
SrcAssociation
,
primaryjoin
=
(
self
.
tbl_source
.
c
.
id
==
self
.
tbl_src_associations
.
c
.
source
))))
mapper
(
SourceACL
,
self
.
tbl_source_acl
,
properties
=
dict
(
source_acl_id
=
self
.
tbl_source_acl
.
c
.
id
))
mapper
(
SrcAssociation
,
self
.
tbl_src_associations
,
properties
=
dict
(
sa_id
=
self
.
tbl_src_associations
.
c
.
id
,
suite_id
=
self
.
tbl_src_associations
.
c
.
suite
,
...
...
@@ -2326,6 +2371,9 @@ class DBConn(Singleton):
properties
=
dict
(
uid_id
=
self
.
tbl_uid
.
c
.
id
,
fingerprint
=
relation
(
Fingerprint
)))
mapper
(
UploadBlock
,
self
.
tbl_upload_blocks
,
properties
=
dict
(
upload_block_id
=
self
.
tbl_upload_blocks
.
c
.
id
))
## Connection functions
def
__createconn
(
self
):
from
config
import
Config
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录