Newbie question =)

Tom Hallman <[email protected]> Wed, 25 Feb 2004 14:56:31 -0500
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
Hi all,

   Here's a situation I have, and I'm trying to figure out how best to do it 
using Modeling.

   I have a Person entity, and it has a ToMany relationship with BankAccount 
entities. One of the attributes of BankAccount is "isDefault", which is 1 if 
the particular account is (duh) the default one, and 0 otherwise.

   So part of the validation logic for validateIsDefault(), I figure, should 
make all other BankAccounts' isDefaults set to 0 if this new account is set 
to 1.

   The problem is that I'd like to get at the editing context which is 
calling validateIsDefault in the first place, so that changing the other 
isDefaults to 0 would *only* happen if the entire new account gets correctly 
saved. (In other words, the ec I create in this function, I think, should be 
a nested ec of the calling ec.)

   Is there a way to do this? Or am I going about this in the wrong way?

   Thanks for any insight!

~Tom

___________________________________________________________
Tom Hallman                             DiscipleMakers, Inc
[email protected]                 http://www.dm.org/~hallmant
531 Brittany Dr * State College * PA * 16803 * 814-861-4591
Go therefore and make disciples of all nations (Matt 28:19)


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click