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

  • Home
  • SEARCH
  • 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 8732809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:30:34+00:00 2026-06-13T09:30:34+00:00

I tried to create template using chameleon. Here is a code snipet. Calling module

  • 0

I tried to create template using chameleon. Here is a code snipet.

Calling module runtemp.py:

delete_list=[]
delete={'Name':'aaa','Sirname':'bbb','Friends':['ccc','ddd','eee']}
delete_list.append(delete)
templates = PageTemplateLoader(os.path.join(path, "templates"))
template = templates["delete_user.pt"]
print template(tdelete_list=delete_list)

Template file delete_list.pt:

 <?xml version="1.0" encoding="UTF-8"?>
 <Delete>
   <DeleteRequest>

       <DeleteItems tal:repeat="deletions tdelete_list">

           <Deleteuser tal:repeat="delete repeat.deletions" >

                <Name tal:content="repeat.delete.Name"></Name>
                <Sirname tal:content="repeat.delete.Sirname"></Sirname>
                 <Friends>
                      <Friend tal:repeat="friend repeat.delete.Friends">
                               <Value tal:content="friend"></Value>
                       </Friend>
                 </Friends>

           </Deleteuser>

     <DeleteItems>

    </DeleteRequest>

 </Delete>

Output i got:

 <Delete>
        <DeleteRequest>

           <DeleteItems>



           </DeleteItems>
  </DeleteRequest>
 </Delete>

My problem is the middle tags are not getting printed; what is wrong?

  • 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-13T09:30:35+00:00Added an answer on June 13, 2026 at 9:30 am

    The line <DeleteItems tal:repeat="deletions tdelete_list"> means to loop over tdelete_list and put each element in the variable deletions.

    Thus, your inner loop just needs to loop over deletions; the repeat. prefix is not used here:

    <Deleteuser tal:repeat="delete deletions" >
    
        <Name tal:content="delete.Name"></Name>
        <Sirname tal:content="delete.Sirname"></Sirname>
         <Friends>
              <Friend tal:repeat="friend delete.Friends">
                       <Value tal:content="friend"></Value>
               </Friend>
         </Friends>
    
    </Deleteuser>
    

    The repeat.deletions variable is actually only used to store loop metadata; the current count, the first and last flags, the odd and even flags, etc.

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

Sidebar

Related Questions

I tried to create a new Swing GUI desktop application template using NetBean 7.0
I'm trying to create project using template from here but when i'm trying to
Tried to create a mobile navigation using dataview or outline and the view renders
I tried to create jar file using command line that I inserted into java
I tried to create a code that adds 2 percent each time a component
I'm trying to create a cpan module that integrates Text::Haml into Template Toolkit. I
I'm using a new item Basic Template with the app name and back button.
I'm using Visual Studio 2010 to create a Word Template. I created a Ribbon
I want to create a view using razor template, but I do not want
I am attempting to create a template using Smarty for php. I would like

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.