title: Django checkbox-database connection
body: <p>Recently i started to learn Django and i am trying to access a BooleanField in my database via browser</p>
  
  <p>this is my form</p>
  
  <pre><code>class NewTopicForm(forms.ModelForm):
   slot1 = forms.BooleanField(required=False)
   slot2 = forms.BooleanField(required=False)
   slot3 = forms.BooleanField(required=False)
  
   message = forms.CharField(
       widget=forms.Textarea(
           attrs={'rows': 5, 'placeholder': 'explanation'}
       ),
       max_length=4000,
       help_text='The max length of the text is 4000.'
   )
  
  class Meta:
       model = Topic
       fields = ['subject', 'message', 'slot1', 'slot2', 'slot3']`
  </code></pre>
  
  <p>this is my view. when i say "board.slot2 = True" it changes my slot2 False to True. but how can i change slot2 in my browser</p>
  
  <pre><code>@login_required
  def new_topic(request, pk):
  board = get_object_or_404(Board, pk=pk)
  if request.method == 'POST':
      form = NewTopicForm(request.POST)
      if form.is_valid():
          topic = form.save(commit=False)
          topic.board = board
          topic.starter = request.user
  
  
          board.slot2 = True
          board.save()
          # board.slot3 = False
          # board.save()
  
          topic.save()
          Post.objects.create(
              message=form.cleaned_data.get('message'),
              topic=topic,
              created_by=request.user
          )
          return redirect('topic_posts', pk=pk, topic_pk=topic.pk)
  else:
      form = NewTopicForm()
  return render(request, 'new_topic.html', {'board': board, 'form': form})`
  </code></pre>
  
  <p>this is my model</p>
  
  <pre><code>class Board(models.Model):
  name = models.CharField(max_length=30, unique=True)
  slot1 = models.BooleanField()
  slot2 = models.BooleanField()
  slot3 = models.BooleanField()
  
  def __str__(self):
      return self.name
  
  def get_posts_count(self):
      return Post.objects.filter(topic__board=self).count()
  
  def get_last_post(self):
      return Post.objects.filter(topic__board=self).order_by('-created_at').first()`
  </code></pre>