Not to throw stones, just trying to understand.

WRT <dtml-var ... fmt=...>

It makes sense to me to use "fmt=something" when the something is an 
instruction on how to format a number or how to format the time. In those 
cases, I'm simply saying how I want the number or time to appear. But when 
I say "fmt=structured-text" then I'm saying how the item is stored.

Let's say that I've developed a Python product that contains description 
and now I've made an instance of it as myDoc. Within my site (application), 
I can ask that description be rendered this way...

<dtml-var "myDoc.description" fmt=structured-text>

By doing so, I'm telling Zope that whatever it finds in myDoc.description 
should be interpreted according to structured text rules from markup 
contained within myDoc.description itself. Now how does my application know 
that the myDoc object has structured text stored in description? Shouldn't 
the object itself know that? And shouldn't the fmt specification tell how 
myDoc.description is to be presented instead of how it is stored?

For example, let's say I can choose to store description as plain text, as 
structured text, or as html. Regardless of how it is stored, I might want 
to ask for it as:

fmt=raw       in case I want to edit it
fmt=html      in case I want to send it to a browser

and so on. Here, raw and html don't describe how to interpret the contents 
of myDoc.description, just how to give it back.

Pointers? I guess I can just fix this within my own product(s) by returning 
various fields in a manner something like this:

Stored as STX, return as HTML

     return str(StructuredText.HTML(self.description))

Stored as STX, return as raw, or stored as HTML, return as HTML

     return self.description

and so on...

Dennis Nichols

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to