Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Customizing Django Templates Building Custom Filters Conjugation Tag

Update the conjugate_is function to return the string 'are' if the number is anything other than 1.

Having trouble with this kinda remember how to do it but I think I'm doing something wrong

code_challenges/templatetags/fairy_extras.py
from django import template

register = template.Library()

def conjugate_is(int): 
    if int == 1: 
        return 'is'
    else int == 1:
        return 'are'
code_challenges/templates/code_challenges/list.html
{% load fairy_extras %}

There is {{ num_elf }} el{{ num_elf|pluralize:"f,ves" }}.
Cody Lovell
seal-mask
.a{fill-rule:evenodd;}techdegree
Cody Lovell
Python Web Development Techdegree Student 7,223 Points

I know this is a late answer, but just in case: you just need to get rid of the second check for "int == 1" in the else clause. Because they want are returned if int is anything other than 1.

2 Answers

Updated code will look like:

from django import template

register = template.Library()

def conjugate_is(int): 
    if int == 1: 
        return 'is'
    else:
        return 'are'

@Cody Lovell Thanks for the help I would mark best answer but it's not giving me the option