Perhaps something like this?

seat = Seat.objects.first()
seat.seat_status == 'BOOKED'



On October 8, 2020 12:46:14 PM CDT, feysel abdu <adamsf...@gmail.com> wrote:
>am sorry for not making it clear, i want to know how to know whether
>the is 
>booked or not  my exiting model is this 
>
>
>class Movies(models.Model):
>MOVIE_GENERE =(
>('A', ' Action'),
>('C','Comedy'),
>('F','Fantasy'),
>('H','Horror'),
>('M','Mystery'),
>('R', 'Romance'),
>('T', 'Thriller'),
>)
>title = models.CharField(max_length=20)
>age = models.IntegerField(default=None)
>description = models .TextField(blank=True )
>movie_start_showing_date_since = models.DateTimeField()
>movie_end_showing_date_till= models.DateTimeField()
>movie_genre = models.CharField(max_length=1, choices=MOVIE_GENERE)
>release_data= models.DateField()
>rating = models.IntegerField()
>movie_runtime = models.CharField(max_length=15, default='2:00:00', 
>help_text='film length')
>movie_normal_price = models.FloatField()
>movie_vip_price= models.FloatField()
>movie_poster = models.ImageField(upload_to ='uploads/')
>MOVIE_SHOWING_IN =(
>('3D','3D'),
>('2D','2D'),
>)
>movie_showing_in =
>models.CharField(max_length=2,choices=MOVIE_SHOWING_IN)
>rated = models.CharField(max_length=15, default=1, null=True,
>blank=True)
>
>
>class Cinema (models.Model):
>cinema_name = models.CharField(max_length=20)
>cinema_total_seat = models.IntegerField()
>
>class Hall (models.Model):
>hall_id = models.IntegerField()
>hall_name =models.CharField()
>number_of_seats = models.IntegerField()
>
>
>
>class Seat(models.Model):
>STATUS =(
>('CANCELED','Canceled'),
>('CONFIRMED','Confirmed'),
>('BOOKED','Booked'),
>)
>seat_no = models.PositiveSmallIntegerField(blank=False, null=False, 
>unique=True)
>row_no = models.PositiveSmallIntegerField(blank=False, null=False)
>seat_name = models.CharField(max_length=3, unique=True)
>booked_by = models.CharField(max_length=200, blank=True)
>seat_status = models.CharField(max_length=20, choices=STATUS)
>number_of_seats= models.IntegerField()
>
>class Reservation (models.Model):
>user_name = models.CharField(max_length=100,unique=True)
># ticket_no =models.ForeignKey(Ticket, on_delete=models.CASCADE, 
>related_name="details")
>row = models.PositiveSmallIntegerField()
>col = models.PositiveSmallIntegerField()
>def __str__(self):
>return "{} - {} - row:{} - col:{}".format(self.username, 
>self.projection_id.time, self.row, self.col)
>
>
>
>
>
>
>On Thursday, October 8, 2020 at 7:06:40 PM UTC+3 Kasper Laudrup wrote:
>
>> On 08/10/2020 13.52, feysel abdu wrote:
>> > I Was building a cinema  booking app and I am using Django , I want
>to 
>> > know available seats and booked seats
>> > 
>>
>> Consider sharing your existing code and be a bit more specific on
>where 
>> you need help.
>>
>> I don't know what kind of answer you expect to get to a question like
>
>> that, if it's even a question?
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "Django users" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to django-users+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/fded2fc3-704e-4346-9ae0-ca2f8b778037n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/65251996-02A4-4F99-968D-E59FF7F63C98%40fattuba.com.

Reply via email to