Hello everybody,

I'm having the <% subject %> problem with Myghty template served by
Pylons.
accessing /index shows the form but call_type argument is not set. I
suspect something is missing in controller.

# config/routing.py
map.connect('*url', controller='template', action='view')

# controllers/template.py
def view(self, url):
  if resource_exists('test/templates', url + '.myt'):
    m.subexec(url + '.myt')
  else:
    m.abort(404, "File not found")

# templates/index.myt
<%args>
        call_type = None
</%args>
<%python scope="init">
</%python>

<h3>/examples/components/index.myt</h3>

<form method="POST" action="index">

        Select the type of component call you would like.
        Press "submit" to enact the call upon the template
"component.myt".
        <br/><br/>

        <input type="radio" name="call_type" value="" <% not call_type
and 'checked' or '' %>>None<br/>
        <input type="radio" name="call_type" value="plain" <% call_type
== 'plain' and 'checked' or '' %>>Plain<br/>
        <input type="radio" name="call_type" value="subrequest" <%
call_type == 'subrequest' and 'checked' or '' %>>Subrequest<br/>
        <input type="radio" name="call_type" value="soft" <% call_type
== 'soft' and 'checked' or '' %>>Soft Redirect<br/>
        <input type="radio" name="call_type" value="hard" <% call_type
== 'hard' and 'checked' or '' %>>Hard Redirect<br/>
        <input type="submit">
</form>

<div style="border:1px solid;margin:20px;padding:10px;">
<%python>
        if call_type=='plain':
                m.comp('component.myt')
        elif call_type=='subrequest':
                m.subexec('component.myt')
        elif call_type=='soft':
                m.send_redirect('component.myt', hard=False)
        elif call_type=='hard':
                m.send_redirect('component.myt', hard=True)
        else:
                m.write("didnt call component")
</%python>
</div>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to