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

Dec 10, 2010 at 4:55 PM

Hi,

Excelent post regarding Creating 1-n and n-n relations: http://orchardproject.net/docs/Creating-1-n-and-n-n-relations.ashx

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.

Thanks,

Coordinator
Dec 10, 2010 at 7: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 10: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.

 

 

 

 

Coordinator
Dec 16, 2010 at 10:21 PM

I have updated the topic for item to item relations: http://orchardproject.net/docs/Creating-1-n-and-n-n-relations.ashx

Dec 17, 2010 at 9:26 PM

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