Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pony
tshistory_supervision
Commits
d79e111546f4
Commit
8e219b93
authored
Mar 04, 2019
by
Aurélien Campéas
Browse files
flag methods that must run within a transaction
parent
150190f1529d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tshistory_supervision/tsio.py
View file @
d79e1115
...
...
@@ -4,6 +4,7 @@ import numpy as np
from
sqlalchemy
import
Column
,
Boolean
,
select
,
desc
from
sqlalchemy.dialects.postgresql
import
BYTEA
from
tshistory.util
import
tx
from
tshistory.tsio
import
TimeSerie
as
BaseTS
...
...
@@ -57,6 +58,7 @@ class TimeSerie(BaseTS):
super
().
__init__
(
*
a
,
**
kw
)
self
.
auto_store
=
BaseTS
(
namespace
=
'{}-automatic'
.
format
(
self
.
namespace
))
@
tx
def
insert
(
self
,
cn
,
ts
,
name
,
author
,
metadata
=
None
,
_insertion_date
=
None
,
manual
=
False
):
...
...
@@ -80,12 +82,14 @@ class TimeSerie(BaseTS):
)
return
a
@
tx
def
delete
(
self
,
cn
,
seriename
):
super
().
delete
(
cn
,
seriename
)
self
.
auto_store
.
delete
(
cn
,
seriename
)
# supervision specific API
@
tx
def
get_overrides
(
self
,
cn
,
name
,
revision_date
=
None
,
from_value_date
=
None
,
to_value_date
=
None
):
autotsh
=
self
.
auto_store
...
...
@@ -104,6 +108,7 @@ class TimeSerie(BaseTS):
manual
.
name
=
name
return
manual
@
tx
def
get_ts_marker
(
self
,
cn
,
name
,
revision_date
=
None
,
from_value_date
=
None
,
to_value_date
=
None
):
table
=
self
.
_get_ts_table
(
cn
,
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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