Re: Accessing single value from multiple values from databse

2019-05-02 Thread Derek
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

Accessing single value from multiple values from databse

2019-04-30 Thread Mayur Bagul
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