Complex CC 5 tables connection using 5 models

jeanyves 22 Mar, 2015
I am having difficulties in creating the last relation to display database information. The current version of the system was done with chronoform V3 and I am trying with CC5 to create tables.

The CF3 version was done some years ago and I need a quick fix immediately!

This is used for a swimathon ( where swimmers (swimmer_model) with basic information (contact_model) are part of a team (team_model) where teams are part of a group (group_model).

1. The first table (group_member_model) contains the member_contact_id is the starting point. The intent is to regroup all swimmers belonging to the same group (group_id) and to eventually regroup the swimming teams and the swimmers under each group. It is a hierarchical structure:

2. The second table contact_model (Relation belongsTo, Associated Model group_member_model, Foreign key member_contact_id) provides the swimmer's name.

3. The third table swimmer_model (Relation hasOne, Associated Model contact_model,, Foreign key contact_id) provides links (i.e. IDs) to the team name found in team_model.

4. The fourth table group_model (Relation belongsTo, Associated Model group_member_model,, Foreign key contact_id) provides the swimmer's group name.

5. The fifth table team_model[/b ([b]Relation belongsTo, Associated Model swimmer_model,, Foreign key team_id) provides the swimmer's team name.

Everything is ok up to the fourth table.

I was unable to connect the fifth table. I have tried belongsTo, hasOne and even hasMany with no success.

MY QUESTION : What is the next step ?

Here are the models and the result. In the result, for debugging purposes, I have included the various IDs needed...







the Swimathon tables used
This topic is locked and no more replies can be posted.