Implementing Many To Many Relationships

Author Message

Joe Simms

Tuesday 28 February 2006 11:57:24 am

Hi

I have been reading your documentation all day and finally am coming to grips with how this system comes together. From what I understand, the following is how someone would implement a many to many relationship:

Create a class called readers
Create a class called books

A reader can have more than one book and a book can have more than one reader.

So i want to:

1. See what books a reader has read, and also what readers have read a particular book.
2. Allow readers to select new books, and this reference is created

So when creating objects for these must i do the following:

Create a node that represents each reader object, and then add child nodes to these representing the relevant books.

Then also create nodes that represent each book, and then add child nodes to these representing the relevant readers.

This seems a little time consuming with the double entry.

I don't understand how your object relation datatype works, but maybe to achieve the above i create an additional content class with two attributes, one that relates to a particular book and the other that relates to a particular reader. If this is the case, then how is this searchable in the admin / filtered in the admin section?

How do i then create a page that will allow registered to users to checkout books and then store this request.

Many thanks

Joe

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.