The logic would be something along these lines (note that you'd need to
sort out the "button click" side)
# class Car(models.Model):
# two_wheeler =
models.CharField(validators=[validate_comma_separated_integer_list])
import random
car = Car.objects.get(pk=1)
numbers = car.two_wheeler.split
Hello community,
i have created three fields in my model Data
- Two-wheeler
- four-wheeler
inside each field i have putted 5 values.
now i wanted to display single random value from these two fields every
time i click on button. and thats where im getting stuck.
How to do this ?
if any
2 matches
Mail list logo