Re: [Zope] have problem with managing objects within a external product

2007-03-12 Thread Maciej Wisniowski

  
 I found out what my problem is.
 in my code I please baseclass Item before Folder
  class ShpProjectClass(Item, Folder, Persistent, Implicit, CatalogAware):
 when I change the order, it worked normally
  class ShpProjectClass(Folder, Item, Persistent, Implicit, CatalogAware):
 but I don't understand why? could someone explain this to me?
Possibly you'll have to read about multiple
inheritance in python. In fact I think instead of 

class ShpProjectClass(Folder, Item, Persistent, Implicit, CatalogAware):

you may use:

class ShpProjectClass(Folder, CatalogAware):

Item, Persistent and Implicit already are base clases of Folder.

-- 
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] have problem with managing objects within a external product

2007-03-11 Thread Allen Huang
Dear AJ, 

Thanks, but I still have some problems with creating a Folderish Object product

I imported Folder from OFS.Folder but I wasn't able to add any products like 
File, Folder, Image with in my folderish object.

my code looks like this--

class ShpProjectClass(Item, Folder, Persistent, Implicit, CatalogAware):
id = 'ShpProject'
meta_type = 'ShpProject'
manage_options = (
{'label':'Contents', 'action':'manage_main'},
{'label':'Properties', 'action':'manage_editShpProjectForm'},
{'label':'View', 'action':'index_html'},
) + Item.manage_options

def __init__(self, id, projectDesc = 'Test Project'):
 Initialize a ShpProject Object 
self.id = id
self.projectDesc = projectDesc

def getProjectInfo(self):
 print a ShpProject Object Info 
return 'This project is called: ' + self.id + '. This project is about 
' + self.projectName + '.'

def edit(self, projectDesc, REQUEST=None):
 edit a ShpProject Object 
self.projectDesc = projectDesc
if REQUEST is not None:
return self.index_html(self, REQUEST)

##Web Methods
index_html = HTMLFile('DTML/index_html', globals())
manage_editShpProjectForm = HTMLFile('DTML/manage_editShpProjectForm', 
globals())

InitializeClass(ShpProjectClass)

what else am I missing? and is using ObjectManager unsave in anyway?


- Original Message 
From: Andreas Jung [EMAIL PROTECTED]
To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org
Sent: Friday, March 9, 2007 4:05:16 PM
Subject: Re: [Zope] have problem with managing objects within a external product


--On 9. März 2007 00:01:50 -0800 Allen Huang [EMAIL PROTECTED] wrote:

 I made a simple product using python that stores some varibles, but I
 couldn't make it acts like a folderish, stores objects, and have a
 content tab page using manage_main like when I use to have when I use
 internal product.

 I reviewed the tutorials on how to make internal products and I found the
 base class modules ObjectManager and PropertySheets under OFS folder but
 I really ahve no idea how to use them.

 So it I want my product to act like an internally made product with
 baseclass ObjectManager, CatalogAware, and use propertysheets to manage
 my attributes and control what object type I want to store,

 would importing ObjectManager, PropertySheets, CatalogAware baseclass be
 enough?

For folderish content you derive from ObjectManager or for being on the 
safe side from OFS.Folder

from OFS.Folder import Folder

class MyType(Folder):

  meta_type= 'MyType'



.

IntiializeClass(MyType)

-aj


 

Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html ___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] have problem with managing objects within a external product

2007-03-11 Thread Allen Huang
Hi. 
 
I found out what my problem is.
in my code I please baseclass Item before Folder
 class ShpProjectClass(Item, Folder, Persistent, Implicit, CatalogAware):
when I change the order, it worked normally
 class ShpProjectClass(Folder, Item, Persistent, Implicit, CatalogAware):
but I don't understand why? could someone explain this to me?


- Original Message 
From: Allen Huang [EMAIL PROTECTED]
To: Zope zope@zope.org
Sent: Monday, March 12, 2007 10:31:27 AM
Subject: Re: [Zope] have problem with managing objects within a external product


Dear AJ, 
 
Thanks, but I still have some problems with creating a Folderish Object product
 
I imported Folder from OFS.Folder but I wasn't able to add any products like 
File, Folder, Image with in my folderish object.
 
my code looks like this--
 
class ShpProjectClass(Item, Folder, Persistent, Implicit, CatalogAware):
id = 'ShpProject'
meta_type = 'ShpProject'
manage_options = (
{'label':'Contents', 'action':'manage_main'},
{'label':'Properties', 'action':'manage_editShpProjectForm'},
{'label':'View', 'action':'index_html'},
) + Item.manage_options

def __init__(self, id, projectDesc = 'Test Project'):
 Initialize a ShpProject Object 
self.id = id
self.projectDesc = projectDesc
 
def getProjectInfo(self):
 print a ShpProject Object Info 
return 'This project is called: ' + self.id + '. This project is about 
' + self.projectName + '.'
 
def edit(self, projectDesc, REQUEST=None):
 edit a ShpProject Object 
self.projectDesc = projectDesc
if REQUEST is not None:
return self.index_html(self, REQUEST)
 
##Web Methods
index_html = HTMLFile('DTML/index_html', globals())
manage_editShpProjectForm = HTMLFile('DTML/manage_editShpProjectForm', 
globals())
 
InitializeClass(ShpProjectClass)

what else am I missing? and is using ObjectManager unsave in anyway?
 
 
- Original Message 
From: Andreas Jung [EMAIL PROTECTED]
To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org
Sent: Friday, March 9, 2007 4:05:16 PM
Subject: Re: [Zope] have problem with managing objects within a external product


--On 9. März 2007 00:01:50 -0800 Allen Huang [EMAIL PROTECTED] wrote:

 I made a simple product using python that stores some varibles, but I
 couldn't make it acts like a folderish, stores objects, and have a
 content tab page using manage_main like when I use to have when I use
 internal product.

 I reviewed the tutorials on how to make internal products and I found the
 base class modules ObjectManager and PropertySheets under OFS folder but
 I really ahve no idea how to use them.

 So it I want my product to act like an internally made product with
 baseclass ObjectManager, CatalogAware, and use propertysheets to manage
 my attributes and control what object type I want to store,

 would importing ObjectManager, PropertySheets, CatalogAware baseclass be
 enough?

For folderish content you derive from ObjectManager or for being on the 
safe side from OFS.Folder

from OFS.Folder import Folder

class MyType(Folder):

  meta_type= 'MyType'



.

IntiializeClass(MyType)

-aj





Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] have problem with managing objects within a external product

2007-03-09 Thread Allen Huang
I made a simple product using python that stores some varibles, but I couldn't 
make it acts like a folderish, stores objects, and have a content tab page 
using manage_main like when I use to have when I use internal product.

I reviewed the tutorials on how to make internal products and I found the base 
class modules ObjectManager and PropertySheets under OFS folder but I really 
ahve no idea how to use them.

So it I want my product to act like an internally made product with baseclass 
ObjectManager, CatalogAware, and use propertysheets to manage my attributes and 
control what object type I want to store, 

would importing ObjectManager, PropertySheets, CatalogAware baseclass be enough?


 

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html ___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] have problem with managing objects within a external product

2007-03-09 Thread Andreas Jung



--On 9. März 2007 00:01:50 -0800 Allen Huang [EMAIL PROTECTED] wrote:


I made a simple product using python that stores some varibles, but I
couldn't make it acts like a folderish, stores objects, and have a
content tab page using manage_main like when I use to have when I use
internal product.

I reviewed the tutorials on how to make internal products and I found the
base class modules ObjectManager and PropertySheets under OFS folder but
I really ahve no idea how to use them.

So it I want my product to act like an internally made product with
baseclass ObjectManager, CatalogAware, and use propertysheets to manage
my attributes and control what object type I want to store,

would importing ObjectManager, PropertySheets, CatalogAware baseclass be
enough?


For folderish content you derive from ObjectManager or for being on the 
safe side from OFS.Folder


from OFS.Folder import Folder

class MyType(Folder):

 meta_type= 'MyType'



.

IntiializeClass(MyType)

-aj



pgplu6AnFYrqr.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )