I am trying to doing a project using nested if. But it's not working. why? My code is,
schedule = Schedule.objects.all()
for c in schedule :
p = c.poll
e = c.end_time
s = c.start_time
n = c.no_of_response
now = timezone.now()
#phn = Response.objects.filter(poll = p).exclude(sid = 'Null').count()
if (c.start_time <= now) & (now <= c.end_time):
if n == 0:
c.poll.status='Running'
c.poll.save()