0
Fala Galera
I have the following app running on Django 1.6.
when clicking on dog or cat the idea would be to present a page performing object filtering
The animal is shaped like this to filter:
TIPO_CHOICES = (
(1, 'Cachorro'),
(2, 'Gato')
)
tipo = models.IntegerField('Tipo', max_length=1, choices=TIPO_CHOICES)
How would my view manipulate this kind of display ?
def cao(request):
cao = Animal.objects.filter(tipo__equal = Cachorro)
template_name = 'Adota/cao.html'
context = {
'cao':cao
}
return render(request, template_name, context)
Thanks for the support, remembering that I am in Django 1.6