Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Accessing object properties from __init__.py

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


riffenstein at gmail

Sep 28, 2009, 10:55 PM

Post #1 of 6 (2111 views)
Permalink
Accessing object properties from __init__.py

Hi All:

I would like to access a certain property of an object from the __init__.py
of my Products folder. Is this possible?

TIA,
A

--
"And the trees are all kept equal
By hatchet, axe, and saw"


lists at zopyx

Sep 28, 2009, 10:57 PM

Post #2 of 6 (1977 views)
Permalink
Re: Accessing object properties from __init__.py [In reply to]

Am 29.09.09 07:55, schrieb Ajay Deshpande:
> Hi All:
>
> I would like to access a certain property of an object from the
> __init__.py of my Products folder. Is this possible?
What is the usecase?

The initialize() method of the Product code get the 'context' parameter
during the startup phase.
Not sure that you are able to proceed from that.

-aj
Attachments: lists.vcf (0.32 KB)


akm at theinternet

Sep 28, 2009, 11:00 PM

Post #3 of 6 (1956 views)
Permalink
Re: Accessing object properties from __init__.py [In reply to]

+-------[ Ajay Deshpande ]----------------------
| Hi All:
|
| I would like to access a certain property of an object from the __init__.py of
| my Products folder. Is this possible?

To get to it from inside Product code you can import the object

from Products.MyProduct import SomeExportedObject

>From any other code you're probably out of luck.

--
Andrew Milton
akm [at] theinternet
_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


riffenstein at gmail

Sep 28, 2009, 11:08 PM

Post #4 of 6 (1954 views)
Permalink
Re: Accessing object properties from __init__.py [In reply to]

That is correct. I need to access object properties.

Thanks,
A

On Tue, Sep 29, 2009 at 11:33 AM, <zopyxfilter [at] gmail> wrote:

> Am 29.09.09 08:00, schrieb Andrew Milton:
> > +-------[ Ajay Deshpande ]----------------------
> > | Hi All:
> > |
> > | I would like to access a certain property of an object from the
> __init__.py of
> > | my Products folder. Is this possible?
> >
> > To get to it from inside Product code you can import the object
> >
> > from Products.MyProduct import SomeExportedObject
> >
> The question was about an object (instance), not about a class.
>
> Andreas
>



--
"And the trees are all kept equal
By hatchet, axe, and saw"


riffenstein at gmail

Sep 28, 2009, 11:25 PM

Post #5 of 6 (1957 views)
Permalink
Re: Accessing object properties from __init__.py [In reply to]

I need to be able to read a data structure from a file and use it in another
product. But the FS path of this file has to be a property. And I need to do
the reading just once, which is why I want to do it in __init__.py.

Thanks,
A

On Tue, Sep 29, 2009 at 11:27 AM, Andreas Jung <lists [at] zopyx> wrote:

> Am 29.09.09 07:55, schrieb Ajay Deshpande:
> > Hi All:
> >
> > I would like to access a certain property of an object from the
> > __init__.py of my Products folder. Is this possible?
> What is the usecase?
>
> The initialize() method of the Product code get the 'context' parameter
> during the startup phase.
> Not sure that you are able to proceed from that.
>
> -aj
>



--
"And the trees are all kept equal
By hatchet, axe, and saw"


lists at zopyx

Sep 28, 2009, 11:40 PM

Post #6 of 6 (1958 views)
Permalink
Re: Accessing object properties from __init__.py [In reply to]

Am 29.09.09 08:25, schrieb Ajay Deshpande:
> I need to be able to read a data structure from a file and use it in
> another product. But the FS path of this file has to be a property.
> And I need to do the reading just once, which is why I want to do it
> in __init__.py.

Proceed as described.

-aj
Attachments: lists.vcf (0.32 KB)

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.