[Catalyst] Avoid adding InflateColumn::DateTime when using the DBIC::Schema Catalyst helper?

J. Shirley jshirley at gmail.com
Sun Apr 26 21:53:22 GMT 2009


2009/4/26 Octavian R=E2=BAni=FE=E3 <orasnita at gmail.com>

> Hi,
>
> Is there a way of avoiding to add the InflateColumn::DateTime component to
> a DBIC class when using the DBIC::Schema catalyst helper?
>
> Or if the component is added, can I add something after "do not modify
> anything above" to disable it entirely?
>
> I want to do this because I have some classes with many date fields, and
> InflateColumn::DateTime give fatal errors when finding MySQL null dates
> (0000-00-00).
>
> And maybe a more important reason is that I would need to modify very many
> templates and instead of [% row.date %], I would need to write [%
> row.date.date %].
>
> Octavian
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

You can add additional column info that sets the datetime_undef_if_invalid
option to the column... or fix MySQL to use real NULL values rather than the
stupid 0000-00-00.

http://search.cpan.org/~mstrout/DBIx-Class-0.08100/lib/DBIx/Class/InflateCo=
lumn/DateTime.pm#register_column

-J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090427/ee871=
e17/attachment.htm


More information about the Catalyst mailing list