in reply to Class DBI Problems

You haven't told has_many which column to use to point back at your charts, so it makes up the moniker "chart", which the XREF table doesn't have. You need to tell it which column to use to get back to your Chart records.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Class DBI Problems
by godzirra (Acolyte) on May 03, 2005 at 21:45 UTC
    How do you do that? I looked in the docs, but I'm guessing I missed something, because I'm still not clear on how that works.

    Godzirra! Destroying Neo Tokyo since 1954

      When setting up the relationship we examine the foreign class's + has_a() declarations to discover which of its columns reference our cla +ss. (Note that because this happens at compile time, if the foreign + class is defined in the same file, the class with the has_a() must be + defined earlier than the class with the has_many(). If the classes are +in dif- ferent files, Class::DBI should be able to do the right thing). + If no such has_a() declarations can be found, or none link to us, we +assume that it is linking to us via a column named after the moniker() + of our class. If this is not true you can pass an additional third arg +ument to the has_many() declaration stating which column of the foreign +class references us.

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.

        I don't understand what I need to do to get that to work, especially since the example doesn't show anything else about tracks other than the line that specifies the has_many for the tracks.

        Godzirra! Destroying Neo Tokyo since 1954