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
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?
that this is
somehow evil. From a previous thread:
Roman Klesel wrote:
form OFS.Image import File
- I build a class _File(File):
I really doubt you need to do that...
- pimped it up a little bit.
What, specifically, did you add?
- _setObject'ed it
You shouldn't be calling that directly...
If you CAN'T
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
Hello,
sorry to come up with this again. I startet 2 pretty confused threads on the
same problem allready:
[Zope] Error Value: 'File' object has no attribute
'manage_fixupOwnershipAfterAdd'
Re: [Zope] context in fs product
Unfortunatly I'm still not getting it right.
I
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 ==
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
Hello,
from doing TTW I'm used to call methods on the object that is passed in by the
context variable.
I'm just writing my first fs based product and was wondering how I can get
context from within a method?
Of course I can try to construct it from self.REQUEST, but ... is this _THE_
way to
Lennart Regebro schrieb:
It's usually called self...
hmmm ... strange ...
in a class:
class Controller(Implicit,ObjectManager, SimpleItem):
asfd
I have a method:
def testspace(self,REQUEST=None):
tests
req = self.absolute_url(self)
return req
and on whatever URL I call
Hello,
Andrew Milton schrieb:
| Thanks so far!
Is it set inside the ZODB yet?
*bling*
yes, that kicked me out of the mental loop.
As you suggested this test class is not in ZODB and therefore the aquisition
does not work.
Therefore my testcase is useless and I've to investigate my
Chris Withers schrieb:
for id in self.manage_targets.keys():
title =
self.manage_targets[id]['name']
self.tgt_folder=Folder()
This is dangerous...
Why is that?
self._setObject(id,self.tgt_folder)
Hello Sascha,
Sascha Welter schrieb:
manage_addFile (and some others like manage_addFolder, ...) work
directly without xy.manage_addProduct[...].
That part is in the Zope book.
The syntax with manage_addProduct[... is used for filesystem based
products (like the stuff you have in your
Hello,
Jens Vagelpohl schrieb:
If that object subclasses
from the normal Zope Folder class (or is a Zope Folder) you *will* have
manage_addProduct.
Yes, actually you guys a right! self.manage_addProduct is available...
Hmmm ... wonder what made me think it's not ...
Still I can't get what
Hello,
one more thing ...
Roman Klesel schrieb:
Your error *may* mean that 'system' is not yet wrapped. Are your
positive that 'system' is a folder that already exists in the ZODB,
i.e. has already been _setObject'ed?
As far as I can tell: Yes!
Actually I'm pretty shure, because as I
Hello again,
I works! I just managed to get everything as I expected it to be.
How I did it:
form OFS.Image import File
- I build a class _File(File):
- pimped it up a little bit.
- instatiated it
- _setObject'ed it
... et voila
I have nice File-objects with nice CMI interface...
Thanks for
Hello again,
I just started with FS products and have trouble to figure some things out ...
From within zope I would like to call scripts that I provide in the product
folder on the file system like eg.:
handle = os.popen('gnuplot %s/bin/loadgraphs.gplt' % product_folder, 'r')
How can I get
Hello Andrew,
Andrew Milton schrieb:
|
| How can I get the path to the product folder?
from Globals import package_home
package_home(globals())
should give you what you need.
yes this does the trick! Thanks!
Greetings Roman
___
Zope
Hi Tino,
Tino Wildenhain schrieb:
How can I get the path to the product folder?
Thanks in advance!
see the __file__ variable in your module.
for example via:
os.path.dirname(os.path.abspath(__file__))
you get the absolute path of the directory
where your module is. Complete it
Hello,
im just learning zope and python and find it difficult to get the details of
aquisition and inheritance.
I have the following problem:
(FS product)
My base class has an attribute manage_editSettingsForm
In its __init__ method I instantiate a contoller class.
In the methods of the
Hello Andrew,
thanks for your reply.
Andrew Milton schrieb:
One (or more) of the following two;
Your class isn't yet fully instantiated and Acquisition wrapped, this normally
doesn't occur until your class is inside the ZODB.
That's true! And it's nor supposed to be. It's only a
bruno modulix schrieb:
So you recommend that I should just skip them as long as I'm on Zope2?
Short answer : yes. Unless you plan to switch to Zope3 really soon, but
then, I'd recommand that you skip Zope 2.x !-)
No, I'll be with Zope2 for a while. I'm running an Plone site too and dont't
Hello,
I'm in the process of learning to develop fs-zope-products.
The developers guide recommends to write interfaces and implement them in
classes. Now my question:
When I have an interface:
DoThings
with several methods:
doThis()
doThat()
doThattoo()
...
and I have an implementation:
bruno desthuilliers schrieb:
Looks like you're newbie to OO too !-)
A class defines a type. You then need to have an instance of that type
(like, say, 42 is an instance of type integer and 'foo' is an instance
of type string).
Yes, true! :-)
(Interfaces (I mean, 'explicit' interfaces)
Hello everyone,
again I'm stuck :-(
I have a python script that looks as follows:
results=[]
for ids in context.objectIds('Folder'):
results.append(ids)
newid = str(int(max(results)) + 1)
context.manage_addProduct['OFSP'].manage_addFolder(newid, title=person)
newaddr=getattr(context,
Hello everyone,
I'm dynamically generate a form e.g like this:
form action=paramtest method=post
table class=normal
tr valign=top align=left
tal:repeat=item
python:context.Templates.AddressTemplate.propertyIds()
td tal:content=itembla/td
tdinput type=text
26 matches
Mail list logo