Qwael 4.0.0.1.2__tar.gz → 4.0.0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/PKG-INFO +1 -1
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael/Multidata.py +24 -7
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael.egg-info/PKG-INFO +1 -1
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/setup.py +1 -1
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/LICENSE +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael/DR/304/260VE.py" +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael/DoIP.py +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael/MultiDB.py +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael/__init__.py +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael/filesz.py +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael.egg-info/SOURCES.txt +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael.egg-info/dependency_links.txt +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael.egg-info/requires.txt +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/Qwael.egg-info/top_level.txt +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/README.md +0 -0
- {qwael-4.0.0.1.2 → qwael-4.0.0.1.4}/setup.cfg +0 -0
|
@@ -218,27 +218,41 @@ class Admin:
|
|
|
218
218
|
|
|
219
219
|
# ------------------------------------------------------
|
|
220
220
|
# ID_CONTROL
|
|
221
|
-
# db.ID_Control("Users", name="Ali")
|
|
221
|
+
# db.ID_Control("Users", name="Ali", ID=veri, Control=durum)
|
|
222
222
|
# ÇIKTI: sadece ID veya None
|
|
223
|
+
# ID -> dışarıdan verilen listeye yazılır
|
|
223
224
|
# ------------------------------------------------------
|
|
224
225
|
def ID_Control(self, table, **kwargs):
|
|
226
|
+
external_id = None
|
|
225
227
|
external_control = None
|
|
226
228
|
|
|
227
|
-
#
|
|
229
|
+
# Dışarıdan ID listesi geldi mi?
|
|
230
|
+
if "ID" in kwargs:
|
|
231
|
+
external_id = kwargs["ID"]
|
|
232
|
+
kwargs.pop("ID")
|
|
233
|
+
|
|
234
|
+
# Control listesi
|
|
228
235
|
if "Control" in kwargs:
|
|
229
236
|
external_control = kwargs["Control"]
|
|
230
237
|
kwargs.pop("Control")
|
|
231
238
|
|
|
239
|
+
# Filtreler geri kalan
|
|
232
240
|
filters = kwargs
|
|
233
241
|
|
|
234
|
-
# Filtre yoksa
|
|
235
242
|
if not filters:
|
|
236
243
|
print("ID_Control Error: name gibi filtre gerekli.")
|
|
237
244
|
if external_control is not None:
|
|
238
245
|
external_control.append(False)
|
|
239
246
|
return None
|
|
240
247
|
|
|
241
|
-
#
|
|
248
|
+
# Dict engeli
|
|
249
|
+
for key, value in filters.items():
|
|
250
|
+
if isinstance(value, dict):
|
|
251
|
+
print(f"ID_Control Error: '{key}' bir dict olamaz.")
|
|
252
|
+
if external_control is not None:
|
|
253
|
+
external_control.append(False)
|
|
254
|
+
return None
|
|
255
|
+
|
|
242
256
|
where_clause = " AND ".join([f"{k}=%s" for k in filters])
|
|
243
257
|
sql = f"SELECT ID FROM {table} WHERE {where_clause} LIMIT 1"
|
|
244
258
|
|
|
@@ -246,19 +260,22 @@ class Admin:
|
|
|
246
260
|
self.cursor.execute(sql, tuple(filters.values()))
|
|
247
261
|
row = self.cursor.fetchone()
|
|
248
262
|
|
|
249
|
-
# Veri yoksa
|
|
250
263
|
if not row:
|
|
251
264
|
print("ID_Control: Veri yok.")
|
|
252
265
|
if external_control is not None:
|
|
253
266
|
external_control.append(False)
|
|
254
267
|
return None
|
|
255
268
|
|
|
256
|
-
#
|
|
269
|
+
# Eğer external ID listesi varsa içine yaz
|
|
270
|
+
if external_id is not None:
|
|
271
|
+
external_id.clear()
|
|
272
|
+
external_id.append(row["ID"])
|
|
273
|
+
|
|
257
274
|
if external_control is not None:
|
|
258
275
|
external_control.append(True)
|
|
259
276
|
|
|
260
277
|
print("ID_Control: ID bulundu:", row["ID"])
|
|
261
|
-
return row["ID"]
|
|
278
|
+
return row["ID"]
|
|
262
279
|
|
|
263
280
|
except mysql.connector.Error as e:
|
|
264
281
|
print("ID_Control Error:", e)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|