I have just started with creating Django app. I have a class in models.py, which have a class variable CATEGORY_CHOICES with values for choices field.
#models.py
from django.db import models
from django.utils import timezone
class Entry(models.Model):
CATEGORY_CHOICES = (
('c1','choice 1'),
('c2','choice 2'),
('c3','choice 3'),
('c4','choice 4'),
)
date = models.DateField(default=timezone.now)
time = models.TimeField(default=timezone.now)
category = models.CharField(choices=CATEGORY_CHOICES,blank=False,null=False,max_length=2)
value = models.TextField()
I want to make form for creting instanes of class Entry. I'm having problem with the select menu, where I want to put values from CATEGORY_CHOICES but I can't figure out how.
<!-- homepage.html -->
{% load staticfiles %}
{% load app_filters %}
<HTML>
<HEAD>
<TITLE>Website title</TITLE>
<link rel="stylesheet" href="{% static "css/app.css" %}">
</HEAD>
<BODY>
<form method="POST" class="form-inline">{% csrf_token %}
<input type="date" class="form-control" id="date-input">
<input type="time" class="form-control" id="time-input">
<select class="form-control">
{% for choice in Entry.CATEGORY_CHOICES %}
<option>{{ choice|get_at_index:1 }}</option>
{% endfor %}
</select>
<input type="text" class="form-control" id="value-input" placeholder="Value">
<input type="submit" value="OK">
</form>
</BODY>
</HTML>
It's a 4 elements list, so {% for choice in Entry.CATEGORY_CHOICES %} should be saving single 2-elements lists (first ('c1','choice 1') then ('c2','choice 2') etc) into variable choice. There I pick the second element of the list with the help od custom filter get_at_index.
#app_filters.py
from django import template
register = template.Library()
@register.filter(name='get_at_index')
def get_at_index(list, index):
return list[index]
I get no errors, but in the final form, there are no options in select menu.

What could be wrong and how to fix it?
#views.py
from django.shortcuts import render
from .forms import EntryForm
def home_page(request):
form = EntryForm()
return render(request, 'app/homepage.html', {'form':form})
And forms.py
#forms.py
from django import forms
from .models import Entry
class EntryForm(forms.ModelForm):
class Meta:
model = Entry
fields = ('date','time','category','value',)
Entry). Please answer @ChristofferKarlsson's first comment