durusmail: quixote-users: Re: Quixote/Simpletal tal:repeat
Re: Quixote/Simpletal tal:repeat
2004-10-10
Re: Quixote/Simpletal tal:repeat
c5qb-3fe3@spamex.com
2004-10-10
In <41697665.1030706@latteier.com> amos@latteier.com wrote:
> c5qb-3fe3@spamex.com wrote:
>  >> This is a weird error, I agree. I'll see if I can improve it. However,
>  >> what you are trying to do is not allowed. quixote_tal.py only allows
>  >> legal quixote URLs in path expressions. If you try to access your
>  >> images object in your webbrowser you'll see that it doesn't work.
>
>  >I'm not sure quite what you mean by the above.
>
> I meant that you are using a bad URL. Did you try the URL is your
> webbrowser? If you did you will notice that Quixote doesn't allow URLs
> that point to lists.

But I'm not accessing it via a url.  Consider the example I referred to at
http://quixote.ca/qx/QuixoteAndSimpleTalAdvanced

So I change the basic application to look like this:

from quixote.quixote_tal import Template, TemplateMethod
from new import instancemethod

_q_exports=['page', 'bill']

# creates a stand alone web page
page=Template('/users/chriseb/www/photo/exp/page.html')

class Person:
    """
    Example class that uses a template to display instances
    """
    _q_exports=['name', 'books']

    def __init__(self, name):
        self.name=name
        self.books = []

    _q_index=TemplateMethod('/users/chriseb/www/photo/exp/person.html')

bill=Person("Bill")
bill.books.append("Test")

And the template person.html to look like:


  

Person

My name is name

I own the following books:

Book name is book

I'll end up with the recurring url problem right here. > P.S. Your questions bring up the point that using Quixote URLs as path > expressions with TAL may not be a good idea. I thought it was a cool way > to integrate TAL and Quixote, but it may be too confusing and possibly > not well suited to the problem of displaying an object in HTML. Perhaps > I should change quixote_tal.py to use normal path expressions and add a > new expression type for Quixote paths. I'm not quite sure what you mean, is it that the quixote module will recursively invoke quixote to get at the value of each path expression? > P.P.S. I am not subscribed to the Quixote list, so please CC me with > questions about quixote_tal.py Thanks! No worries. I appreciate the time and energy you have spent answering my questions. --
reply