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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 4.0.0.1.2
3
+ Version: 4.0.0.1.4
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -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
- # Control dışarıdan gelmişse al
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
- # SQL hazırla
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
- # Veri bulundu
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"] # 🔥 Yalnızca ID döner
278
+ return row["ID"]
262
279
 
263
280
  except mysql.connector.Error as e:
264
281
  print("ID_Control Error:", e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 4.0.0.1.2
3
+ Version: 4.0.0.1.4
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="Qwael",
8
- version="4.0.0.1.2",
8
+ version="4.0.0.1.4",
9
9
  packages=find_packages(),
10
10
  install_requires=[
11
11
  "google-api-python-client",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes