[Catalyst] CRUD, but with multiple tables involved

Sean Davis sdavis2 at mail.nih.gov
Fri Jan 6 13:21:28 CET 2006


This is not really a catalyst-specific question, but there is a lot of
brain-power and experience lurking on this list, so I ask here.  (Oh, did I
mention, I am using Catalyst for developing this?)

I have a table in the database "Dogs" that stores information like the name,
date-of-birth, kennel club ID, registry name, etc.  With each dog, I also
want to store the owner (stored in a contacts table), a breed (in the breeds
table), a sire and dam (these are references back into the "Dogs" table).
In short, there are foreign keys that I need to account for.  If all of
these external objects (owner, breed, etc) already exist, they can be simply
included in a dropdown list.  However, if one doesn't exist, the story is
different and I need to allow users to create them.  I can see multiple ways
of doing this:

1)  Make a set of "input" screens that force the user to choose all the
"foreign objects" first and have the option on each page (breed, owner,
parents) to create new entries as needed or to choose existing ones.
Advantages: simple to create and can utilize the /list, /add, /edit
functions for each of breed, owner, etc.

2)  Make a single page that does everything in one shot.  This would
probably require either refreshes or AJAX calls to update dropdown lists and
would make "searching" breed, owner, etc. hard to do.

3)  Make a single page that has links to "create new owner", "created new
breed", etc.  This is probably what I envision being able to accomplish.

Are the general hints or specific examples of this kind of application in
action?

Thanks,
Sean





More information about the Catalyst mailing list