I've done a couple cheap and cheerful ORMs in various languages. I always punt on doing the relationships because finishing the app is more urgent than writing a whole framework. I just add an instance method that executes the appropriate SQL to fetch the related objects. You can spend a lot of time trying to do this in a generic declarative way, or you can just write a query as an instance method and get on with finishing your app.
On Jun 10, 2019, at 5:20 AM, sergio ruiz <sergio.rrd@gmail.com> wrote:
I am currently putting together a Seaside website for my radio show. I am trying to figure out how to model the "has and belongs to many" relationships.
Each episode can have many tracks, each of these tracks can belong to several episodes. I want to be able to present a listing of which episodes each track appears in, and a listing of tracks for each episode.
The approach I have seen on this is to create an intermediary object and store a set of ids on this, but this seems a little clunky, and it seems like there would be a clean way to do this. Am I missing something? Thanks!
---- peace, sergio photographer, journalist, visionary
Public Key: http://bit.ly/29z9fG0 <http://bit.ly/29z9fG0> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com <http://www.codeandmusic.com/> http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101