# Copyright (c) 2006 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: TupleList.bunit,v 1.3 2009/05/01 17:10:57 nagler Exp $ ListModel(); req()->set_realm_and_user(qw(fourem btest_read)); req()->initialize_fully('FORUM_TUPLE_EDIT'); my($tdid) = model(TupleUseList => {auth_id => req('auth_id')}) ->moniker_to_id('psr'); model('Tuple')->delete_all; foreach my $x (0..3) { #TODO: This is yucky code. Need to encapsulate req()->clear_nondurable_state; my($tslf) = model('TupleSlotListForm'); req()->put(query => {parent_id => $tdid}); $tslf->process({ %{$tslf->get_fields_for_primary_keys}, slot_0 => "a$x\@a.a", slot_1 => "s$x", comment => 'anything', }); if (my $l = req()->unsafe_get('Model.Lock')) { $l->release; } } [ load_all => [ [{parent_id => $tdid}] => [{ 'Tuple.tuple_num' => 1, 'Tuple.slot1' => 'a0@a.a', 'Tuple.slot2' => 's0', }, { 'Tuple.tuple_num' => 2, }, { 'Tuple.tuple_num' => 3, }, { 'Tuple.tuple_num' => 4, 'Tuple.slot2' => 's3', }], ], is_slot_defined => [ 1 => 1, 2 => 1, 3 => 0, ], ];