Talk Galera
I have the following app running in Django 1.6.
when clicking on dog or cat the idea would be to present a page doing the filtering of the object
The animal is modeled thus to filter:
TIPO_CHOICES = (
(1, 'Cachorro'),
(2, 'Gato')
)
tipo = models.IntegerField('Tipo', max_length=1, choices=TIPO_CHOICES)
How would my view handle this type of view?
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