Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Adressen Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maximilian Loch
Adressen Integration
Commits
e57a76ce
Commit
e57a76ce
authored
1 year ago
by
Maximilian Loch
Browse files
Options
Downloads
Patches
Plain Diff
added new variable for column dienstart
parent
5f6d81d4
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
adressen_update_script.py
+2
-1
2 additions, 1 deletion
adressen_update_script.py
example_conn.cfg
+4
-1
4 additions, 1 deletion
example_conn.cfg
script_helper.py
+6
-3
6 additions, 3 deletions
script_helper.py
with
12 additions
and
5 deletions
adressen_update_script.py
+
2
−
1
View file @
e57a76ce
...
...
@@ -17,6 +17,7 @@ if __name__ == '__main__':
user=
{
conn_config
[
'
connection
'
][
'
user
'
]
}
password=
{
conn_config
[
'
connection
'
][
'
pwd
'
]
}
"""
table
=
conn_config
[
"
connection
"
][
'
table
'
]
dienstart
=
conn_config
[
"
daten
"
][
'
dienstart
'
]
url
=
conn_config
[
'
connection
'
][
'
url
'
]
...
...
@@ -31,7 +32,7 @@ if __name__ == '__main__':
print
(
str
(
i
)
+
"
/
"
+
str
(
lenschule
))
if
item
[
0
]
is
not
None
:
adresse
=
my_api
.
findadresse
(
item
[
0
])
my_db
.
update_adress
(
adresse
,
item
[
0
],
table
)
my_db
.
update_adress
(
adresse
,
item
[
0
],
dienstart
,
table
)
else
:
print
(
"
hat keine URI
"
)
...
...
This diff is collapsed.
Click to expand it.
example_conn.cfg
+
4
−
1
View file @
e57a76ce
...
...
@@ -6,3 +6,6 @@ user=username
pwd
=
password
url
=
API url
table
=
tablename
[daten]
dienstart
=
dienstart
\ No newline at end of file
This diff is collapsed.
Click to expand it.
script_helper.py
+
6
−
3
View file @
e57a76ce
...
...
@@ -115,7 +115,7 @@ class DBTools:
self
.
cursor
.
execute
(
sql_alter
)
self
.
cursor
.
execute
(
sql_update
)
def
update_adress
(
self
,
data
:
"
dict[str,str]
"
,
param_uri
:
str
,
table
:
str
)
->
None
:
# noqa
def
update_adress
(
self
,
data
:
"
dict[str,str]
"
,
param_uri
:
str
,
dienstart
:
str
,
table
:
str
)
->
None
:
# noqa
"""
Updaten der Adressen mit AREG URI
Funktion zum Update der Datenbank mit den neuen Adressdaten aus dem
...
...
@@ -136,11 +136,13 @@ class DBTools:
add column if not exists
hnr varchar,
add column if not exists
st
rasse
varchar,
st
n
varchar,
add column if not exists
plz varchar,
add column if not exists
ort varchar,
add column if not exists
dienstart varchar,
add column if not exists
geom geometry(Point, 4326);
"""
...
...
@@ -150,9 +152,10 @@ class DBTools:
{
table
}
set
hnr=
'
{
data
[
'
hnr
'
]
}
'
,
st
rasse
=
'
{
data
[
'
stn
'
]
}
'
,
st
n
=
'
{
data
[
'
stn
'
]
}
'
,
plz=
'
{
data
[
'
plz
'
]
}
'
,
ort=
'
{
data
[
'
ort
'
]
}
'
,
dienstart=
'
{
dienstart
}
'
,
geom=ST_GeomFromGeoJSON(
'
{
geometry
}
'
)
where
areg_uri=
'
{
param_uri
}
'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment