[html-formfu] Validate DBIx::Class unique constraints

Erez Schatz moonbuzz at gmail.com
Sun Nov 28 17:17:10 GMT 2010


We've been using FormFu in a Catalyst-DBIx::Class project, and we've
found that while FormFu has no problem updating the database, it ignores
any unique key constraints (__PACKAGE__->add_unique_constraint([
qw/field_name/ ]);), causing a DB exception to be thrown.

I was attempting to circumvent this by creating a "Unique" class that
would invalidate the form if a value exists in the DB. However, this
doesn't work if the user enters his own information, and I've no way of
getting the user's information from within a constrain_value sub.

Your help's appreciated,

Observations, not opinions.

More information about the HTML-FormFu mailing list