I just released my first pubic facing Django site, and have run into a
design problem. It's a music blog / band site at
http://www.victimoftime.com
Something I didn't consider when I was building it (I'm the tech guy,
others are the content people) is that at a given concert, the bands
play in a specific order, and that order is important.
I chose to use Many to Many relationships for concerts and bands, so
that I can easily give a view of a particular concert, with the bands
involved, click on a band, and get a listing of upcoming shows, etc.
The problem is, how can I preserve the many to many relationship, but
have a specific order for the bands? Any ideas?
If nothing else, I'm probably going to include a field for band order
that's just a string. Then use some regexes to figure out which band
is which from the list.
Thanks in advance.
Chris
You should be able to take the QuerySet of bands for the concert and
tack on an 'order_by()' to sort by whatever field you like on the band
model.
--
"May the forces of evil become confused on the way to your house."
-- George Carlin
That's a good idea, except the bands will be in a different order
depending on the show they're in. Somedays Stevie Wonder is the
headliner, other days he's just opening for Prince.
Thanks for the idea. I think this might be a complicated thing to
handle, without an easy answer.
Chris
Let me know if you find something better.
Yann
-
http://www.djangoproject.com/documentation/models/m2m_intermediary/
Yann