Good morning,

I need a constraint which is identical to Constraint::DBIC::Unique in concept, but requires slightly different implementation. I can either create my own or supply patches for Constraint::DBIC::Unique. So I'm asking for comments from others.

Currently C::DBIC::Unique will only check for unique values by doing a 'find' (& checking primary keys) before returning true/false.

Rather than doing a find on a column in the resultset, I need to call a method on the resultset and return that value. The resultset method is simply checking for uniqueness across two tables, so maybe there is a better way of achieving that anyway.

Thoughts? Comments? Should I write a custom constraint or does this sound like a good addition to C::DBIC::Unique? My idea was to create an alternate config option; rather than supplying 'column' in the Constraint config, supply 'method' instead. And C::DBIC::Unique would simply return the value from 'method' rather than doing a column find.

Another thought I had was a custom resultset class (view?) which combines both tables and just using C::DBIC::Unique as it is now. But that seems like more effort and not as clean.


Charlie

--
   Ꮚ Charlie Garrison ♊ <[email protected]>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to