Implement and showing many to many relations?

Author Message

Adolfo Barragán

Tuesday 25 March 2003 2:37:38 am

I'm newbie in ez publish, and I don't know how to implement many to many relations. In a database model, I make the following but, how can I do in ez publish?

I the conceptual model Ihave 3 classes (Countries, Packs, Species) and 3 relations: Countries--Packs (1:M); Countries--Species (M:M) and Packs--Species (M:M). In addition, the relation Countries-Species have their owns attributes and also the relation Packs-Species.

So, In the physical model I have 5 classes (tables): Countries, Packs, Species, Countries_Species, Packs_Species and their relations are:
Countries--Packs (1:M)
Countries--Country_Species (1:M)
Species--Country_Species (1:M)
Packs--Pack_Species (1:M)
Species--Pack_Species (1:M)

When an user click on "content/view/full/Country_Id" I need show the attributes of Country_Id plus a list of Species of that country (and attributes of relation) plus a list of Packs of that country.

Similary with "content/view/full/Pack_Id", I need show Pack's attributes plus a list of Pack's Species (and attributes of relation).

And finally, when the user click on "content/view/full/Specie_Id I need show Specie's attributes plus a list of Packs and Countries where Specie is assigned to.

I'm sorry the extension of question but I'm weeks to battle with this and I don't find a solution.

Thanks in advance

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

eZ debug

Timing: Jan 18 2025 11:37:43
Script start
Timing: Jan 18 2025 11:37:43
Module start 'layout'
Timing: Jan 18 2025 11:37:43
Module start 'content'
Timing: Jan 18 2025 11:37:44
Module end 'content'
Timing: Jan 18 2025 11:37:44
Script end

Main resources:

Total runtime0.5711 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.2969152.6563
Module start 'layout' 0.00520.0034 741.953139.5078
Module start 'content' 0.00860.5608 781.4609406.3516
Module end 'content' 0.56940.0016 1,187.81258.1094
Script end 0.5711  1,195.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5747160.0002
Check MTime0.00130.2284160.0001
Mysql Total
Database connection0.00060.104710.0006
Mysqli_queries0.533493.3930460.0116
Looping result0.00040.0724440.0000
Template Total0.544395.320.2722
Template load0.00240.412720.0012
Template processing0.542094.898720.2710
Template load and register function0.00020.034510.0002
states
state_id_array0.00080.133310.0008
state_identifier_array0.00120.210120.0006
Override
Cache load0.00200.3463160.0001
Sytem overhead
Fetch class attribute can translate value0.00040.074310.0004
Fetch class attribute name0.00060.109410.0006
XML
Image XML parsing0.00010.024510.0001
class_abstraction
Instantiating content class attribute0.00000.000710.0000
General
dbfile0.00060.1007100.0001
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs