Hi,

I am using DBIx::Class along with Catalyst. Everything seems to be
working fine, however I am having a problem with deflation of a date
when I am trying to update the database.

I have tried the following:


__PACKAGE__->add_column(date => { data_type => 'date' });  

and on another occasion:

__PACKAGE__->inflate_column('date', {
    inflate => sub { DateTime::Format::MySQL->parse_date(shift) },
    deflate => sub { DateTime::Format::MySQL->format_date(shift) },
});

Now in my app I have:

my $article = $c->model('Pacdb::File::Article')->find_or_create(id =>
$id);
$article->set_column(date => $params{date}); # format dd/mm/yyyy
$article->update;

Now the problem is that DBIx does not seem to be deflating this and
puts it in as 'dd/mm/yyyy'. I have also tried update_or_create which
does not work either. I can't seem to get this working, please any
ideas?

I have read
http://lists.rawmode.org/pipermail/dbix-class/2006-May/001349.html
which seems to indicate that it should work.

-- 
Thanks

Nick Edwards <[EMAIL PROTECTED]>
Information Systems Administrator
Summerleaze RE-Generation Ltd
Tel: 01628 411943


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

Reply via email to