Files
django-core-base/apps/common/utils.py
minguezsanzjuanjose 1e78ad3a40 Initial commit
2026-04-11 03:31:05 +02:00

11 lines
272 B
Python

# 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