Damm !*% tab key!

Sorry I didn't finish my code snippet.


 Hi,

 If you use find_or_new to check for the existence of a row, and it
 return empty (in_storage is not set) can you add to the the object
 before you insert? A bit like this:

  my $obj = $rs->find_or_new({ blah => 'blarg' });
  if ($obj->in_storage) {
    # do whatever else you wanted if it was a new row
  }
  else {
 $obj->foo(bar);
 $obj->insert;
  }


My test seem to indicate not because the foo field on my table is not
nullable and the driver is screaming at me when the insert is
attempted. Is there no autovivification with objects?
Dp.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to