Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8026767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:35:49+00:00 2026-06-04T23:35:49+00:00

I have a TemplateColumn in a django-tables2 table and I want to use a

  • 0

I have a TemplateColumn in a django-tables2 table and I want to use a custom template filter (named int_to_time) to transform the data. When I use a built in filter it works fine.

What I have done until now is that I’ve copied the templates\django_tables2\table.html from django-tables2 to my project and included my tag library to table.html.

However, when I try to render my view, I get the following error:

TemplateSyntaxError at /details_show/2012/3/13/2
Invalid filter: 'int_to_time'

The error seems to be in line 28 of table.html

{% for column, cell in row.items %}

I can confirm that my tag library is loading because if for instance I write the name of the tag library wrong then I will get a Template library not found error.

Please help !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:35:51+00:00Added an answer on June 4, 2026 at 11:35 pm

    Simplest solution

    TemplateColumn renders the column externally to the template. Any custom filters or tags you load in the template won’t be available.

    You should be able to load the custom filter when you define the TemplateColumn. Something like:

    name1 = tables.TemplateColumn('{% load my_filters %}{{ record.name|int_to_time }}')
    

    Alternative (suggested by Bradley in comments)

    Instead of using TemplateColumn in the class defining your table. Use a Column, but define a method render_columnname() with the formatting. Something like:

    from myfilters import int_to_time
    
    class MyTable(tables.Table):
        time = tables.Column()
    
        def render_time(self, value):
            return int_to_time(value)
    

    See Table.render_FOO() Methods for more detail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I render a table with django-tables2.This is it: class VehiclesTable(tables.Table): id = tables.TemplateColumn(verbose_name=' ',template_name='editButton.html')
How do I programmatically bind data to a custom item template column for a
Experts, I have JQGrid with custom template column like Edit. the following screen display
Right now I have a datagrid with a template column as follows: <asp:TemplateColumn> <ItemTemplate>
I have a vendor application which is precompiled. I want to add a template
I have a situation: DataGrid with TemplateColumn. Template contains Stack panel with CheckBox and
I have a TemplateColumn in my telerik radgird like below : <telerik:GridTemplateColumn FilterControlAltText=Filter TemplateColumn_Commands
I have a Silverlight DataGrid that contains a single template column which displays a
have 2 questions : A computer with 32-bit address uses 2-level page table (9
I have a ASPX.NET DataGrid and im trying to USE a select LIKE 'X'%

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.