[Dbix-class] New module: DBIx::Class::InflateColumn::ISBN

Christopher H. Laco claco at chrislaco.com
Fri May 25 16:02:37 GMT 2007


K. J. Cheetham wrote:
> Following in Ilmari's footsteps I have created
> DBIx::Class::InflateColumn::ISBN which inflates/deflates to a
> Business::ISBN object.
> =

> You can find it in the SVN repo at
> http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class-InflateColumn-IS=
BN/
> and if it's not horribly broken I intend to release it to CPAN in it's
> current state as version 0.01.
> =

> Hopefully it'll become useful to someone. ;-)
> =

> Best wishes
> =


Nice trend. I dig it.
As I mentioned to others, join the cult, use the long version numbers:
0.01000....

Just out of curiosity, the deflater:

  deflate =3D> sub { return shift->common_data; },

I don't see a common_data method in B::ISBN 1.84 (Release), only in the
2x Dev version...maybe I'm just blind...

If not, either use B::ISBN 2.00, or tweak your Makefile.PL prereq, or
use an alternate deflate method for older versions...

Aside from the that, I have to ask what the general InflateColimn::*
modules goals should be for DBIC.

Personally, in things like ::Currency, I always daflate back to exactly
what _format_ I was given in the database...if I get a number, I don't
save back anything but a number...

So, with things like ::IP and ::ISBN, what is the correct thing to do?
Should ISBN inflate from '1565922573' but save back ->common_data (which
is '1-56592-257-3'), or should it deflate back to the format it was
given? (->input_isbn which is the raw input form the db/user)?

I believe IP allows the user the choose what method to use to deflate
before saving to the DB...maybe ISBN should do the same...or maybe not.
Just curious.

Welcome to the InflateColumn club.

-=3DChris


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070525/d8=
7a6b5b/signature.pgp


More information about the Dbix-class mailing list