DmitrMakeev commited on
Commit
5f55a94
1 Parent(s): fc8d727

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -1
app.py CHANGED
@@ -11,7 +11,7 @@ import logging
11
  import csv
12
  import io
13
  from urllib.parse import quote
14
- from base import replace_null_with_empty_string
15
  from datetime import datetime
16
  import pytz
17
 
@@ -1925,6 +1925,50 @@ def from_shop_st2():
1925
 
1926
 
1927
  # Функция для замены NULL на пустые строки в base_py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1928
 
1929
 
1930
  # Маршрут для приема GET запроса
 
11
  import csv
12
  import io
13
  from urllib.parse import quote
14
+
15
  from datetime import datetime
16
  import pytz
17
 
 
1925
 
1926
 
1927
  # Функция для замены NULL на пустые строки в base_py
1928
+ # Функция для замены NULL на пустые строки
1929
+ def replace_null_with_empty_string(conn):
1930
+ cursor = conn.cursor()
1931
+ query = """
1932
+ UPDATE contacts
1933
+ SET
1934
+ name = COALESCE(name, ''),
1935
+ phone = COALESCE(phone, ''),
1936
+ email = COALESCE(email, ''),
1937
+ vk_id = COALESCE(vk_id, ''),
1938
+ chat_id = COALESCE(chat_id, ''),
1939
+ ws_st = COALESCE(ws_st, ''),
1940
+ ws_stop = COALESCE(ws_stop, ''),
1941
+ web_st = COALESCE(web_st, ''),
1942
+ fin_prog = COALESCE(fin_prog, ''),
1943
+ b_city = COALESCE(b_city, ''),
1944
+ b_fin = COALESCE(b_fin, ''),
1945
+ b_ban = COALESCE(b_ban, ''),
1946
+ b_ign = COALESCE(b_ign, ''),
1947
+ b_baners = COALESCE(b_baners, ''),
1948
+ b_butt = COALESCE(b_butt, ''),
1949
+ b_mess = COALESCE(b_mess, ''),
1950
+ shop_st = COALESCE(shop_st, ''),
1951
+ curator = COALESCE(curator, ''),
1952
+ pr1 = COALESCE(pr1, ''),
1953
+ pr2 = COALESCE(pr2, ''),
1954
+ pr3 = COALESCE(pr3, ''),
1955
+ pr4 = COALESCE(pr4, ''),
1956
+ pr5 = COALESCE(pr5, ''),
1957
+ gc_url = COALESCE(gc_url, ''),
1958
+ key_pr = COALESCE(key_pr, ''),
1959
+ n_con = COALESCE(n_con, ''),
1960
+ canal = COALESCE(canal, ''),
1961
+ data_on = COALESCE(data_on, ''),
1962
+ data_t = COALESCE(data_t, ''),
1963
+ utm_source = COALESCE(utm_source, ''),
1964
+ utm_medium = COALESCE(utm_medium, ''),
1965
+ utm_campaign = COALESCE(utm_campaign, ''),
1966
+ utm_term = COALESCE(utm_term, ''),
1967
+ utm_content = COALESCE(utm_content, ''),
1968
+ gcpc = COALESCE(gcpc, '')
1969
+ """
1970
+ cursor.execute(query)
1971
+ conn.commit()
1972
 
1973
 
1974
  # Маршрут для приема GET запроса