On Sun, May 06, 2007 at 09:16:41AM -0400, Jason Kohles wrote:
> So everybody probably saw my confusion with inflation from yesterday,  
> and while it is all working now (thanks Claco!) I have to admit I  
> still find the behavior counter-intuitive at best.  I guess when I  
> was just inflating DateTime objects it made more sense, since the  
> inflated values were so much more complex than the representation  
> that was stored in the database, but when I started using  
> DBIx::Class::InflateColumn::Currency, it seemed odd to me that  
> '$10.00' would be inflated to a Data::Currency object if it came from  
> the database, but not if it came from the user.  I've fixed this for  
> my immediate need by writing an HTML::FormFu::Inflator subclass that  
> parallels DBIx::Class::InflateColumn::Currency, but going forward I'd  
> like to avoid repeating so much code, so I've come up with an idea to  
> extend DBIx::Class::InflateColumn to allow user-provided values to be  
> inflated the same way that database values are.

Well, if you call $obj->inflated_field('$10.00');

then do $obj->inflated_field; the second call will return the inflated object.

I'm not sure I see what the problem you're trying to solve is?

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
Shadowcat Systems Ltd.   Contact mst (at) shadowcatsystems.co.uk for a quote
                                          http://www.shadowcatsystems.co.uk/ 

_______________________________________________
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