Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<%namespace:defname> converts the method name to lowercase #108

Closed
sqlalchemy-bot opened this issue Apr 16, 2009 · 4 comments
Closed

<%namespace:defname> converts the method name to lowercase #108

sqlalchemy-bot opened this issue Apr 16, 2009 · 4 comments
Labels
bug Something isn't working lexer low priority

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Anonymous

This raises a problem when the defname contains uppercase letters as the closing tag won't match the opening tag meaning you have to fall back to using call to call the method.

=== Example ===

<%def name="renderPanel(panel)">
    <div class="x-panel">
        <h1 class="x-panel-title">${panel.title}</h1>
        <div class="x-panel-content">
        </div>
    </div>
</%def>

<%def name="renderTablePanel(panel)">
    <%self:renderPanel panel="${panel}">
        ${self.renderTable(panel.table)}
    </%self>
</%def>

=== Error ===
SyntaxException: Closing tag does not match tag: <%self:renderpanel> in file 'panels.mao' at line: 46 char: 2


Attachments: fix-namespacedef.patch

@sqlalchemy-bot
Copy link
Author

Anonymous wrote:

Missed out the caller.body in the example:

<%def name="renderPanel(panel)">
    <div class="x-panel">
        <h1 class="x-panel-title">${panel.title}</h1>
        <div class="x-panel-content">
            ${caller.body()}
        </div>
    </div>
</%def>

<%def name="renderTablePanel(panel)">
    <%self:renderPanel panel="${panel}">
        ${self.renderTable(panel.table)}
    </%self>
</%def>

@sqlalchemy-bot
Copy link
Author

Anonymous wrote:

The attached patch appears to fix the error, I've no idea if the .lower() was only required just makes things case sensitive?

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

weird, that lower() must have been there since the beginning. thanks for the patch, b06cd0f.

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lexer low priority
Projects
None yet
Development

No branches or pull requests

1 participant