[Zope] Re: Creating a New Object Type - Use ZClass or Pytho

ej@ee.duke.edu ej@ee.duke.edu
Tue, 03 Aug 1999 07:05:33 -0700


Thanks for all the responses.  He he... I should have known better, though.  Of the first three responses from Anthony, Michel, and Kevin, I got 3 totally different responses.

If I had known more about XML, I probably would have used that approach, but I'm gonna focus on Zope for the moment.  And of the other two, I chose to use ZClasses simply because I felt a non-Python person would have a better chance of fixing the site in the future.  Still, I've added some Python routines when my novice DTML skills drag a 1 minute function into taking 30.

So I've gotten my Publication class written and it works - but minus a few features.  

1.
The main problem is that I haven't been able to get ZCatalog to search my author list (a line property) correctly.  I can search on any other property accept this one.  My feeling is that it is treating the entire list as a single property instead of breaking the list items out as individual authors.  Does anyone have any insight into this?  

For the moment, I have a python function that searches the author list.  Simple, but I need to figure out how to do it in ZCatalog.

2.
Also, I haven't figured out how to make a selection property using ZClasses.  I read a post about adding a selection_list (or something like that) property to the propertysheet.  This worked, but the selection_list property was also visible on my objects property sheets - not too pretty.  I wanted to have multiple selection list also, but this seemed impossible.  For the moment, I've hard coded the list in DTML.  Any better way?

thanks for everyone's help,

eric

 <02bc01beda6e$262f3bc0$8342109-@duke.edu> wrote: 
original article:http://www.egroups.com/group/zope/?start=8850
> Hello,
> 
> Forgive me if this is a double post - I sent it to zope@egroups.com , and it
> never appeared in the posts as far as I could tell.
> 
> I'm pretty comfortable with Python, but new to Zope.  We're trying to figure
> out the best way to set up an academic web site that has a list of
> publications on it.  Each publication has several authors, a description,
> etc.  It will also have a pdf and perhaps a postcript copy of the article.
> We need to be able to search the author list.  I'd like to create a PubClass
> that, when it displays itself looks like:
> 
> "Some silly paper" IEEE Trans. on Antennas and Propagation
>     Description: Some rubbish about how great the silly paper is.
>     Authors: Eric Jones, Larry Carin, William Joines
>     PDF: link_to_pdf_file_object (size)
>     PS: link_to_ps_file_object (size)
> 
> I'd like the Add form to have places for adding all the basic properties.
> The paper title, journal name, and description are pretty straight forward I
> think.  The authors are a little more troubling.  I'd like to make them a
> list of tuples:
> 
> [ (first_name,last_name), (first_name,last_name),...]
> 
> to facilitate searching for a particular author (so that only Larry Carin's
> papers are displayed on his page).   Is there a way to do this sort of thing
> with ZClasses?  Also, I want the Add form to have places to browse for the
> pdf and ps files - much like a Zope File object - and then add these files
> to the PubClass object.
> 
> Is this best done by creating a class in python or with the ZClass
> interface?
> 
> thanks,
> eric
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )