[Zope] - How do I NOT acquire an object from a parent?
Jim Fulton
jim@digicool.com
Fri, 15 Jan 1999 13:01:08 +0000
Brad Clements wrote:
>
> Well, I'm working on my web site for "New York State Aviation", and it's
> starting off fairly well.. I wanted to model the layout similar to
> www.Zope.org
>
> I'm using TinyTable to create my folder specific sidebar (it's great)
>
> But, I'd like subfolders to be able to add their own "middle sidebar" if a
> property is defined in that folder, (and not two folders above). How can I
> check to see if a given property exists in the current folder, and isn't
> being acquired from above?
Interesting question. You can get the current folder
in a form that does *not* acquire by accessing the
Acquisition-defined special attribute, aq_base.
For simple properties, it should be sufficient
to test:
<!--#if "_.hasattr(aq_base, 'propname')"-->
if you need to test for an object with security settings
things would be bit more complicated, since most objects
acquire permissions.
> How can I use style sheets with zope? I see zope.org has a style
> sheet. Do I just upload the .css file as a file object in the parent and
> refer to it in the standard_html_header?
Yes.
> It'd be nice if a "Document" could be structuredText. I was thinking of
> adding a "fmt" property to a document and setting it to "StructuredText"
> but I don't think that'd work.
I assume that you'd also rig the compilation machinery to
call the structures text converter. This should work.
This could most easily be done by overriding the cook
method.
We plan to support something like this in 1.10.
I was thinking of either:
- DTML Documents and
- StructuredText Documents (that can use DTML)
or
- A single DTML document that has an option
to process it's inoput through structured text
when it is compiled.
Probably the second option is the way to go.
Opinions?
> To use structuredText, I have to have two file objects defined.
Actually, a file and a Document.
> Any
> suggestions to work around this?
>
> Paul also said in www.egroups.com/list/zope/922.html, that Amos was
> working on documenting "mailto, relative URLs, footnotes".. I've looked
> through StructuredText.py and can't figure out urls or mailto's in the .py I
> have. Is that because it's not supported, or not documented?
It's because it was tacked as an afterthought:
- mailto:
"bla blah":mailto:address.
note that the address *must* be followed by a period or comma.
- relative URL:
"bla blah":foo.html.
note that the URL *must* be followed by a period or comma.
- "footnotes" are really "references" borrowed from a system
called "stext":
blah blah [ref] bla blah
.... bla blah
.. [ref] the definition/reference
The actual "definition" line must *begin* with ".. [ref]".
The reference name, ref, may contain letters, digits, underscores
and dashes.
See the ExtensionClass documentation (in
lib/Components/ExtensionClass/ExtensionClass.stx
in a Zope source distribution) for examples of this.
> Now I just need to add 44 folder objects, one for each airport in new
> york.. sigh
You should be able to automate this with a DTML
script pretty easily.
Jim
--
Jim Fulton mailto:jim@digicool.com
Technical Director (540) 371-6909 Python Powered!
Digital Creations http://www.digicool.com http://www.python.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.