Initial commit
This commit is contained in:
11
apps/common/utils.py
Normal file
11
apps/common/utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Ejemplo de limpieza de tipos para SQL
|
||||
def clean_sql_string(value):
|
||||
if value is None:
|
||||
return ""
|
||||
return str(value).strip().replace("'", "''")
|
||||
|
||||
def clean_sql_int(value):
|
||||
try:
|
||||
return int(value)
|
||||
except (ValueError, TypeError):
|
||||
return 0
|
||||
Reference in New Issue
Block a user