Generation

generate functionWed, 03 May 2023

si me llega de un post la variable services[1,2,3] como guardarlos de forma independiente cada uno de este array con save()

from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ def validate_comma_separated_integer_list(value): """ Check that the input is a comma-separated list of integers. """ for val in value.split(','): try: int(val) except ValueError: raise ValidationError( _('%s is not an integer.' % val), code='invalid', )

Want to kickstart your project?Use the new AI Studio to create your code