[Twisted-web] Redering common patterns

Sridhar Ratna aka Srid sridharinfinity at gmail.com
Sun Feb 13 07:03:23 MST 2005

Hello all,

I have sequence of Posts to render.  The Post object has an involved
xml-template as show below

    <!-- List of recent Posts -->
    <n:invisible n:data="recentPosts" n:render="sequence">
        <!-- A Post -->
        <div n:pattern="item" class="blogEntryBody">
            <h2 class="title">
                <n:invisible n:data="title" n:render="post_title"/>
            <div n:data="at" n:render="post_date"  class="date"></div>
            <div n:data="body" n:render="xml"></div>
            <div class="posted">
                in <span n:data="tags" n:render="sequence">
                <n:invisible n:pattern="item" n:render="tag"></n:invisible>
                <span n:pattern="divider">|</span>

Now, I need to re-use this Post pattern (below 'A Post comment) in
multiple places.  If you place them in a seperate file, it would be
imposibble to use them in this example (sequence renderer).

Do you think of any solution?

"duplication is bad idea, so could not resist"

Sridhar Ratna - http://srid.bsdnerds.org

More information about the Twisted-web mailing list