Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
6723100c
Commit
6723100c
authored
Jul 06, 2012
by
Clément Schreiner
Browse files
Split PluginResult model; data now in PluginResultData.
(for easier access from outside plugins)
parent
19dbfac2
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/model/plugin_results.py
View file @
6723100c
...
...
@@ -38,17 +38,28 @@ from debexpo.model import meta, OrmObject
from
debexpo.model.package_versions
import
PackageVersion
t_plugin_results
=
sa
.
Table
(
'plugin_results'
,
meta
.
metadata
,
sa
.
Column
(
'plugin'
,
sa
.
types
.
String
(
200
),
primary_key
=
True
),
sa
.
Column
(
'package_version_id'
,
sa
.
types
.
Integer
,
sa
.
ForeignKey
(
'package_versions.id'
),
primary_key
=
True
),
sa
.
Column
(
'id'
,
sa
.
types
.
Integer
,
primary_key
=
True
),
sa
.
Column
(
'key'
,
sa
.
types
.
String
(
200
),
primary_key
=
True
),
sa
.
Column
(
'value'
,
sa
.
types
.
Text
()),
sa
.
Column
(
'plugin'
,
sa
.
types
.
String
(
200
)),
sa
.
Column
(
'package_version_id'
,
sa
.
types
.
Integer
,
sa
.
ForeignKey
(
'package_versions.id'
),
nullable
=
False
),
)
t_plugin_result_data
=
sa
.
Table
(
'plugin_result_data'
,
meta
.
metadata
,
sa
.
Column
(
'plugin_result_id'
,
sa
.
ForeignKey
(
'plugin_results.id'
),
primary_key
=
True
),
sa
.
Column
(
'key'
,
sa
.
types
.
String
(
200
),
primary_key
=
True
),
sa
.
Column
(
'value'
,
sa
.
types
.
Text
()),
)
class
PluginResult
(
OrmObject
):
foreign
=
[
'package_info'
]
foreign
=
[
'package_version'
]
class
PluginResultData
(
OrmObject
):
foreign
=
[
'plugin_results'
]
plugin_result_mapper
=
orm
.
mapper
(
PluginResult
,
t_plugin_results
,
...
...
@@ -60,3 +71,9 @@ plugin_result_mapper = orm.mapper(PluginResult,
}
)
plugin_result_data_mapper
=
orm
.
mapper
(
PluginResultData
,
t_plugin_result_data
,
properties
=
{
'plugin_result'
:
orm
.
relation
(
PluginResult
,
backref
=
'result_data'
),
}
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment