[Zope] catalog aware not working.. help

Bakhtiar A Hamid bakhtiar.ahamid at gmail.com
Tue Mar 20 21:17:16 EDT 2007


On 3/20/07, Allen Huang <swapp0 at yahoo.com> 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 at 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


More information about the Zope mailing list