title: What is the equivalent of None and Null in Django if statements
body: <p>I am trying to check if an object instance already exists in the model or if it's empty.
  I'm new to Django and I can't figure out the logic behind making that happen here.
  This is my function code and what I'm trying to do (In views.py):</p>
  
  <pre><code>def registerAttendee(request,pk):
      act = Activity.objects.get(pk=pk)
      act.save()
      attendee, _ = Attendee.objects.get_or_create(student=request.user)
      if act.attendee.get(student=request.user) is None:
          act.attendee.add(attendee)
          messages.success(request, 'You\'re successfully registered as an attendee!', extra_tags='alert')
      else:
          messages.warning(request, 'You\'re already registered as an attendee!', extra_tags='alert')
          return redirect('home/#work')
  </code></pre>
  
  <p>I'm basically checking, if the user is not registered in this activity, then I'm going to add him/her, but if the user is already registered, I'm displaying a specific message.
  My current code doesn't work because I'm getting an "Invalid Syntax" error on the word None. I tried replacing it with NULL and BLANK but I'm still getting this error.
  What do I replace it with?</p>
  
  <p>This is what I have in models.py in case it helps:</p>
  
  <pre><code>class Attendee(models.Model):
  student = models.ForeignKey(User, related_name="attendee")
  
  class Activity(models.Model):
  type = models.CharField(max_length=50, default="")
  title = models.CharField(max_length=200, default="")
  description = models.CharField(max_length=500)
  owner = models.ForeignKey(User, related_name="owner")
  college = models.CharField(max_length=200)
  location = models.CharField(max_length=200)
  room = models.CharField(max_length=200)
  startDate = models.DateTimeField(null=True, blank=True)
  endDate = models.DateTimeField(null=True, blank=True)
  attendee = models.ManyToManyField(Attendee, related_name="attendees",null=True, blank=True)
  volunteer = models.ManyToManyField(Volunteer, related_name="volunteers",null=True, blank=True)
  </code></pre>