Re: Beginner many-to-many problems

[prev] [thread] [next] [Date index for 2004/07/12]

From: Jesse Sheidlower
Subject: Re: Beginner many-to-many problems
Date: 16:23 on 12 Jul 2004
On Sun, Jul 11, 2004 at 01:40:38PM -0400, Edward J. Sabol wrote:
> Jesse Sheidlower wrote:
> >> Second, I'd like to add a citation with accompanying subjects,
> >> preferably in one shot. 
> 
> Tony replied:
> > You can't. You'll need to write something yourself to do this.
> 
> Jesse, assuming you're using a database that supports transactions, check out
> http://www.class-dbi.com/cgi-bin/wiki/index.cgi?AtomicUpdates

Thanks, but I'm afraid I am not using a transaction-capable database
(I'm using MySQL with MyISAM tables).

Is it the multiple addition that I would have to write myself? What
would be the way of adding a single subject to an existing citation
object? Again, the basic setup is that there's a many-to-many
correspondence between my Citation class and my Subject class, looking
like this:

package Citations;
use base 'Citations::DBI';
__PACKAGE__->set_up_table("citation");
__PACKAGE__->has_many(subject => [ CitationSubject => 'subject_id' ]);

Thanks very much.

Jesse Sheidlower

Beginner many-to-many problems
Jesse Sheidlower 02:13 on 11 Jul 2004

Re: Beginner many-to-many problems
Tony Bowden 08:03 on 11 Jul 2004

Re: Beginner many-to-many problems
Jesse Sheidlower 16:23 on 12 Jul 2004

Re: Beginner many-to-many problems
Tony Bowden 20:42 on 13 Jul 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52