[Zope] fmt=structured-text seems wrongish

2000-10-09 Thread Dennis Nichols

Not to throw stones, just trying to understand.

WRT 

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...



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
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] fmt=structured-text seems wrongish

2000-10-10 Thread Dieter Maurer

Dennis Nichols writes:
 > 
 > 
 > 
 >  And shouldn't the fmt specification tell how 
 > myDoc.description is to be presented instead of how it is stored?
I agree with you that "fmt" should specify how the value should
be formatted and not 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
I fear, the "fmt" machinery will not know, how the value
is marked up (plain/stx/html). This knowledge would
be necessary for a format change.

Currently, I would say, this is not a task for the "fmt"
argument but for the application.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )