Roman Klesel wrote at 2006-3-3 10:26 +0100:
...
Yes, this is what I understood (at least I think so) now. So the question is:
How will the method find out what object I want it to operate on if I call it
in this way
context/genGraphs or objref/genGraphs
It cannot.
It works for a PythonScript
Andrew Milton schrieb:
Perhaps if you describe the problem you're trying to solve, we can actually
help you.
Yes, thank you!
I just want to be able to do what I'm used to do from TTW:
- There is a hirarchy of Folder/File objects
- In the root directory there is an python script
+---[ Roman Klesel ]--
| Andrew Milton schrieb:
|
| Perhaps if you describe the problem you're trying to solve, we can actually
| help you.
|
|
| Yes, thank you!
| just as in my example above I want to be able to call this methods on any
File objects from a ZPT
Andrew Milton schrieb:
| ul
| li tal:repeat=elem context/objectValues
| img tal:attributes=src string: ${elem/absolute_url}/genGraph plot
/img
| /li
| ul
In what way doesn't this work? I've certainly used this pattern in my FS
products without problems.
Hmm? Did I miss something?
+---[ Roman Klesel ]--
| Andrew Milton schrieb:
| | ul
| | li tal:repeat=elem context/objectValues
| | img tal:attributes=src string: ${elem/absolute_url}/genGraph plot
/img
| | /li
| | ul
|
| In what way doesn't this work? I've certainly used this pattern in
Andrew Milton schrieb:
How about you forget about Acquisition for now.
Well, hmmm ... this will be hard ... I was just about to fall in love with it
...
Define the method in the class you want to call it on.
Then I will have to subclass from OFS.Image.File and I was told that this is
+---[ Roman Klesel ]--
| Andrew Milton schrieb:
| How about you forget about Acquisition for now.
|
|
| Well, hmmm ... this will be hard ... I was just about to fall in love with it
...
It's definitely useful, but, you have to pick your moments to use it.
| Define
Roman Klesel wrote at 2006-3-3 08:20 +0100:
...
In your case, the method test3 is not defined by Folder
but by what you call your product instance (still a wrong term!).
Therefore, its self is necessarily an instance of your product
(I keep your wrong term). And self.getId() gives
Hello,
Roman Klesel schrieb:
I can call this method on whatever folder inside the product instance I
want, it will always return the id of the
product and not the id of the product I call it on.
In order to make my problem more obvious I created a minimal product. See
attachmet.
It
Roman Klesel wrote at 2006-3-2 08:13 +0100:
...
I can call this method on whatever folder inside the product instance
(instance of the base class ZLTMS) I want, it will
always return the id of the instace of the base class (where the method is
defined) and not the id of the object (Folder
+---[ Roman Klesel ]--
| Hello,
|
| Roman Klesel schrieb:
| I can call this method on whatever folder inside the product instance I
want, it will always return the id of the
| product and not the id of the product I call it on.
|
| In order to make my problem more
+---[ Roman Klesel ]--
| Hello,
| class ZLTMS(Lasttest,Implicit, Persistent, PropertyManager, ObjectManager,
SimpleItem):
| ZLMTS object
|
| ... has an import method
|
| def newLasttest(self, REQUEST=None):
|new
|
Hello Andrew,
Andrew Milton schrieb:
Are you sure your genId() method works?
Well, yes, it does what it's ment to do. It generates an id, a string.
Here it is:
def genId(self,context):
asdf
items = [ int(e[2:]) for e in context.objectIds('Folder') ]
Andrew Milton schrieb:
Did you paste this code, because it has errors...
Ahh sorry, I missed the last charakter, a ).
Here it is again:
def genId(self,context):
asdf
items = [ int(e[2:]) for e in context.objectIds('Folder') ]
if items ==
Roman Klesel wrote at 2006-3-1 13:24 +0100:
...
I can call this method on whatever folder inside the product instance I want,
it will always return the id of the
product and not the id of the product I call it on.
I fear you will need to more clearly describe what you mean
with the product (on
Dieter Maurer schrieb:
I can call this method on whatever folder inside the product instance I want,
it will always return the id of the
product and not the id of the product I call it on.
I fear you will need to more clearly describe what you mean
with the product (on one hand) and the
16 matches
Mail list logo