I have many different relationships in my models, and I'm trying to reorganize them on one of my pages.
There is a video on my site. On each video page, I try to list the participants who are in this video, with links each time they are in the video (links will skip this part of the video).
Here is an illustration
Flash video is included here.
Actors ...
Ted smith: 1:25, 5:30
jon jones: 5:00, 2:00
Here are the relevant parts of my models
class Video(models.Model):
actor = models.ManyToManyField( Actor, through='Actor_Video' )
class Actor_Video(models.Model):
actor = models.ForeignKey( Actor )
video = models.ForeignKey( Video)
time = models.IntegerField()
This is what my Actor_Video table looks like, it might be easier to see what im does
id actor_id video_id time (in seconds)
1 1 3 34
2 1 3 90
I feel that I need to reorganize the information in my opinion, but I cannot figure it out. This is not possible in a template using djangos orm. I tried a couple of things with creating dictionaries / lists, but I was out of luck. Any help is appreciated. Thank.