cinema booking

172 views
Skip to first unread message

feysel abdu

unread,
Oct 8, 2020, 9:00:46 AM10/8/20
to Django users
I Was building a cinema  booking app and I am using Django , I want to know available seats and booked seats 

Mohammad Ahshan Danish

unread,
Oct 8, 2020, 10:41:59 AM10/8/20
to django...@googlegroups.com
you need to have available seat in database

On Thu, Oct 8, 2020 at 6:29 PM feysel abdu <adam...@gmail.com> wrote:
I Was building a cinema  booking app and I am using Django , I want to know available seats and booked seats 

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e21cefa9-8127-4ddd-ac74-3400b36eef17n%40googlegroups.com.


--
Thanks & Regards 
  
Regards, 
Danish

Kasper Laudrup

unread,
Oct 8, 2020, 12:06:40 PM10/8/20
to django...@googlegroups.com
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

feysel abdu

unread,
Oct 8, 2020, 1:49:00 PM10/8/20
to Django users
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)






Ryan Nowakowski

unread,
Oct 8, 2020, 8:51:27 PM10/8/20
to django...@googlegroups.com
Perhaps something like this?

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

Dvs Khamele

unread,
Oct 11, 2020, 1:03:52 PM10/11/20
to django...@googlegroups.com
Hi do you hire contract based python/django freelancer?
 We can help you in this and related tasks at fair prices. Reply or send email to div...@pythonmate.com
Best Regards, 
Divyesh Khamele,
Pythonmate

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages