Solved.

The django documentation at 
http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#url
shows that the URL template takes a comma-separated list of values.  I
tried doing the following:

{% with "enhance" as command %}
<form action="{% url myview.executeCommand myId command %}"
method="post">
{% endwith %}

and it worked fine.  Kind of a dirty workaround, really.  I've since
revamped my stuff into my own custom template because I was repeating
myself too much, and the problem naturally sorted itself out.

- ryan.

On Nov 5, 8:14 am, ryan baldwin <[EMAIL PROTECTED]> wrote:
> Hi.  I'll try and keep this brief.  I have a view that takes 2
> arguments; an id and some string.  I have the following URL defined in
> my URLS:
>
> url(r'^my/url/(?P<myId>\d+)/(?P<myStringCommand>[\w_]*)/$',
> 'myview.executeCommand', name='myview.executeCommand'),
>
> What I hope to achieve with the above URL is the following:
> eg. my/url/123/doSomething/
>
> On my view, passed into my template I have the following:
> return render_to_response('myview/edit.html', {'myId':someId})
>
> On my template, I have the following:
> <form action="{% url myview.executeCommand
> myId=myId,myStringCommand=enhance %}" method="post">
>
> In the above {% url %} template, "enhance" is just some arbitrary
> string.  Everything seems fine, except the "enhance" part is not being
> rendered out.  This is what is rendered:
> <form action="/my/url/123//" ...>
>
> Note the double forward slash.  If I don't use named parameters I get
> the same result.  If I wrap "enhance" in single quotes I get the
> following error (which makes little sense to me):
>
> Could not parse the remainder: ''enhance'' from ''enhance''
>
> What am I doing wrong?  Shouldn't the URL template in the form render /
> my/url/123/enhance/ ??
>
> Please stear me in the right direction if I'm way off course here....
> this is my first go of Python, GoogleAE and Django.
>
> Thanks.
>
> - ryan.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to