I'm defining some objects using DBIx::Class::Schema with the intention of using deploy to create my tables and have come up with a couple questions. These maybe just me doing something simple wrong, so please be patient... I'm in information overload, ATM. :)

1) When you are using has_one can you overload the child object name? For example, if I have an object called system and want to attach a point_of_contact, owner and vendor and they are all actually user objects. I've tried '__PACKAGE__->has_one(Point_of_Contact => 'NEOpS::WDS::Users');' but that's not working. Any of the examples I've found just have simplest case usage with little or not extending of the concept.

2) I've been building this, from a directory point of view, in a very heirarchical manner. So for package NEOpS::WDS in the /lib/DB/NEOpS dir (this is in the catalyst framework dir stuc). There WDS.pm has

package NEOpS::WDS; use base qw/DBIx::Class::Schema/; __PACKAGE__->load_classes(); 1;
Then in the WDS dir, I have object_name.pm for each object I'm declaring. I've noticed that most of the examples I'm finding seem to be very flat by comparison... should I just to this all in the /NEOpS/WDS.pm?

Thanks,


--Jimbus aka Jim Babcock
Wireless Data Engineer and Geek Wannabe
jim-dot-babcock-at-usa-dot-com

2006-10-12 Retitled by castaway, as per Monastery guidelines
Original title: 'DBIx:questions'


In reply to DBIx::Class questions by jimbus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.