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 trialJude Molloy
7,470 PointsCustomizing Django Templates conjugate_is templatetag
Not sure what is wrong
from django import template
register = template.Library()
@register.simple_tag
def conjugate_is(num):
if num == 1:
return 'is'
else:
return 'are'
{% load fairy_extras %}
There {{ conjugate_is num=num_elf }} {{ num_elf }} el{{ num_elf|pluralize:"f,ves" }}.
2 Answers
Kenneth Love
Treehouse Guest Teacherconjugate_is
is a tag so it needs to be called with {%
and %}
. The {{
represents when you want to print out a value, not use a tag.
Kenneth Love
Treehouse Guest TeacherI'm not currently planning a "Payments in Django" course but you're not the first to ask about it so maybe I should! If so, it'll be after the new year.
Jude Molloy
7,470 PointsI think it would be a very useful course that would interest a lot of people, so hopefully there will be one :)
Jude Molloy
7,470 PointsJude Molloy
7,470 PointsThank you :) Do you know if there will ever be a course on payments with Django?