Parent/Child n-m relation possible?

Parent/Child n-m relation possible?

nklinkersnklinkers Posts: 24Questions: 4Answers: 0

Hello,

is it possible to have a n-m relation in the parent/child example instead of 1-n relation?
So what I want is 1 site with possible multiple users. One user can be in multiple sites?

Thanks in advance.

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    I'm trying to get my head round this - could you give an example of the kind of data that would call for this approach?

    Basically, your "parent" row (1) could have many "child" rows (n).
    How would n:m figure in this scenario?

  • nklinkersnklinkers Posts: 24Questions: 4Answers: 0

    Well, I have playlist records and want to add the child table where files are in the records. Each file is uploaded already so I have an in between table with playlist-id and file-id. Each file can be in 1 or more playlist. I don't know how to handle this with the in between table. When I take the files table as child table, than it is a 1-n relation. So 1 file can hav eonly 1 playlist, just like in the sample with sites-users.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Do you currently have server-side processing and parent/child display up and running at all?

  • nklinkersnklinkers Posts: 24Questions: 4Answers: 0

    The parent/ child not yet. I tried to make it but discovered that it was not what I wanted. What I have is the playlist datatables and the media library with upload. What I want is these 2 combined so that the user can select a playlist and add uploaded files to that playlist. I thougt the parent/child example was a good start but missing the possibilty to add 1 file to different lists if wanted.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    I'm working on something roughly similar, coincidentally also a music-based application but with no sound files - purely an information database.
    For example, where my parent row might have details of a recording artist - name, date of birth, birthplace etc. - my child row(s) might be a list of songs recorded by that artist. I currently return the song list as a block of HTML with an ordered list.
    I will be incorporating urls into that list, enabling movement to a different view where the parent row is the song and the child row is the list of artists who have recorded it. Thus users can easily move around within the data.
    I don't know if this is any help in your situation, as I have no upload requirement and no media library. But certainly many things are possible with the parent/child concept.

This discussion has been closed.