Search code examples
google-app-enginepyjade

pyjade on gae cannot concatenate 'str' and 'long' objects


The below pyjade code causes an internal server error. When the #{module.key} is taken outside the href it works fine. Any ideas?

table
    // the table isn't working perfectly but leo is making responsive 
    // anyway, will merge that version
    each module, m in modules
      if (m % 5 == 0)
        tr
          td
            a(href='#{module.key}') #{module.name}
      else 
        td
          a(href="#{module.key}") #{module.name}

enter image description here


Solution

  • What one has to do is divide up the array into a 2D array in the backend and then iterate over the rows in the jade template. Within each row iteration, write a tr and iterate through the cols of that row. When iterating through the cols, write the td and its content.