Creating 1-n and n-n relations, with Parts

Dec 10, 2010 at 3:55 PM


Excelent post regarding Creating 1-n and n-n relations:

This explains Part -> Record and Record -> Record relations.

The one question I did have is how should this work for releated parts, Part -> Part relations?

i.e. Would it not be normal for a BlogPostPart to contain a reference to the BlogPart? so that the BlogPostPartRecord table contains a FK to the BlogPart or BlogPartRecord.

I'm creating a forum, hence a PostPart needs a reference to a TopicPart and ForumPart.


Dec 10, 2010 at 6:29 PM

Well, what you really want to do technically is reference the record for what happens to be a part. You know what? I think I'll try that and add it to the tutorial.

Dec 13, 2010 at 9:26 AM

@bertrandleroy have you had a chance to try this?

At the moment I'm getting the releated record and the part, but I need a way to "convert" the record to a part so that I can access the associated parts i.e. slug, getting both is inefficient.





Dec 16, 2010 at 9:21 PM

I have updated the topic for item to item relations:

Dec 17, 2010 at 8:26 PM

@bertrandleroy -> thanks for that it really helped me out.