DmitrMakeev
commited on
Commit
•
7955f76
1
Parent(s):
11adb51
Update app.py
Browse files
app.py
CHANGED
@@ -292,23 +292,23 @@ def load_data_from_json():
|
|
292 |
items = data['info']['items']
|
293 |
fields = data['info']['fields']
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
|
310 |
-
|
311 |
-
|
312 |
|
313 |
@app.before_first_request
|
314 |
def before_first_request():
|
@@ -335,7 +335,6 @@ def before_first_request():
|
|
335 |
|
336 |
|
337 |
|
338 |
-
|
339 |
|
340 |
|
341 |
|
|
|
292 |
items = data['info']['items']
|
293 |
fields = data['info']['fields']
|
294 |
|
295 |
+
db = 'data_gc.db' # Указываем конкретную базу данных
|
296 |
+
conn = sqlite3.connect(db)
|
297 |
+
cursor = conn.cursor()
|
298 |
|
299 |
+
for item in items:
|
300 |
+
user_data = dict(zip(fields, item))
|
301 |
+
query = '''
|
302 |
+
INSERT INTO contacts (
|
303 |
+
name, phone, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress, shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url, curator
|
304 |
+
) VALUES (
|
305 |
+
:Имя, :Телефон, :Email, :vk_id, :chat_id, :ws_st, :ws_stop, :web_st, :fin_prog, :shop_st, :pr1, :pr2, :pr3, :pr4, :pr5, :ad_url, :curator
|
306 |
+
)
|
307 |
+
'''
|
308 |
+
cursor.execute(query, user_data)
|
309 |
|
310 |
+
conn.commit()
|
311 |
+
conn.close()
|
312 |
|
313 |
@app.before_first_request
|
314 |
def before_first_request():
|
|
|
335 |
|
336 |
|
337 |
|
|
|
338 |
|
339 |
|
340 |
|