[Zope] catalog aware not working.. help

2007-03-20 Thread Allen Huang
I made a pyhon product with catalogaware as one of my base class but my 
zcatalog named 'catalog' doesn't automatically catalog when I add a product 
item. what could be a problem?

Please help

this is part of my code that include catalogawareness:

class ShpTypePointClass(Item, Persistent, Implicit, CatalogAware):
#print ShpTypePointClass
id='ShpTypePoint'
meta_type='ShpTypePoint'
manage_options = (
{ 'label':'Properties','action':'manage_editShpTypePoint' },
) + Item.manage_options

#_properties=(
#{ 'id':'title', 'type':'string', 'mode':'w'},
#{ 'id':'x', 'type':'string', 'mode':'w'},
#{ 'id':'y', 'type':'string', 'mode':'w'}
#)

def __init__(self, id, x, y, dbfInfo):
#print 'initializing'
self.id = id
self.x = x
self.y = y
self.dbfInfo = dbfInfo
self.reindex_object()
def printPoint(self):
#print print Point
return br printPoint Method br ID: + self.id +  -- (  + self.x  
+ ,  + self.y +  )
def edit(self, x, y, REQUEST=None):
Edit the Point
#print edit
self.x = x
self.y = y
self.reindex_object()
if REQUEST is not None:
return self.manage_editShpTypePoint(self, REQUEST)
##Web Methods
index_html = HTMLFile('DTML/index_html', globals())
manage_editShpTypePoint = HTMLFile('DTML/manage_editShpTypePoint', 
globals())
InitializeClass(ShpTypePointClass)


 

Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097___
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] catalog aware not working.. help

2007-03-20 Thread Jonathan


- Original Message - 
From: Allen Huang [EMAIL PROTECTED]

To: Zope zope@zope.org
Sent: Tuesday, March 20, 2007 3:09 AM
Subject: [Zope] catalog aware not working.. help


I made a pyhon product with catalogaware as one of my base class but my 
zcatalog named 'catalog' doesn't automatically catalog when I add a product 
item. what could be a problem?


I am not sure if this is your problem, but I have a vague recollection that 
the ZCatalog needs to be named 'Catalog' (initial capital).



Jonathan 


___
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] catalog aware not working.. help

2007-03-20 Thread Bakhtiar A Hamid

On 3/20/07, Allen Huang [EMAIL PROTECTED] wrote:


I made a pyhon product with catalogaware as one of my base class but my
zcatalog named 'catalog' doesn't automatically catalog when I add a product
item. what could be a problem?

Please help

this is part of my code that include catalogawareness:

class ShpTypePointClass(Item, Persistent, Implicit, CatalogAware):


iirc, CatalogAware has to first like so:
class ShpTypePointClass( CatalogAware, Item, Persistent, Implicit):

hth


#print ShpTypePointClass
id='ShpTypePoint'
meta_type='ShpTypePoint'
manage_options = (
{
'label':'Properties','action':'manage_editShpTypePoint' },
) + Item.manage_options

#_properties=(
#{ 'id':'title', 'type':'string', 'mode':'w'},
#{ 'id':'x', 'type':'string', 'mode':'w'},
#{ 'id':'y', 'type':'string', 'mode':'w'}
#)

def __init__(self, id, x, y, dbfInfo):
#print 'initializing'
self.id = id
self.x = x
self.y = y
self.dbfInfo = dbfInfo
self.reindex_object()
def printPoint(self):
#print print Point
return br printPoint Method br ID: + self.id +  -- (  +
self.x  + ,  + self.y +  )
def edit(self, x, y, REQUEST=None):
Edit the Point
#print edit
self.x = x
self.y = y
self.reindex_object()
if REQUEST is not None:
return self.manage_editShpTypePoint(self, REQUEST)
##Web Methods
index_html = HTMLFile('DTML/index_html', globals())
manage_editShpTypePoint =
HTMLFile('DTML/manage_editShpTypePoint', globals())
InitializeClass(ShpTypePointClass)


 
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
___
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 )





--
http://myzope.kedai.com.my - my-zope org
___
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 )