Hi,<br><br>I find for a number of models that I am using in my current project, I am creating actions for adding records so that I can validate that certain fields are not duplicated in the database rather than just using the Create&lt;Name&gt;.pm automatic action.&nbsp; I think that I could do this my having a validation function specified in the record definition within my model file, but is there a reason that we don't just use the 'is distinct' attribute to get the 
<a href="http://Action.pm">Action.pm</a> default validator to do the checking always?<br><br>I hacked this into my local copy and it seemed to work fine:<br><br>Index: lib/Jifty/Action/Record.pm<br>===================================================================
<br>--- lib/Jifty/Action/Record.pm&nbsp; (revision 1124)<br>+++ lib/Jifty/Action/Record.pm&nbsp; (working copy)<br>@@ -227,7 +227,7 @@<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If we're hand-coding a render_as, hints or label, let's use it.<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (qw(render_as label hints length mandatory sort_order)) {<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (qw(render_as label hints length distinct mandatory sort_order)) {<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( defined $column-&gt;$_ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $info-&gt;{$_} = $column-&gt;$_;
<br>Index: lib/Jifty/Action.pm<br>===================================================================<br>--- lib/Jifty/Action.pm (revision 1124)<br>+++ lib/Jifty/Action.pm (working copy)<br>@@ -699,6 +699,15 @@<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;<br>+&nbsp;&nbsp;&nbsp; if ( $field_info-&gt;{distinct} &amp;&amp; defined $value) {<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $u = $self-&gt;record_class-&gt;new();<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $u-&gt;load_by_cols( $field =&gt; $value);<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($u-&gt;id) {<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $self-&gt;validation_error(
<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $field =&gt; q{There is already an entry with that value} );<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>+&nbsp;&nbsp;&nbsp; }<br>+<br>&nbsp;&nbsp;&nbsp;&nbsp; # If we have a set of allowed values, let's check that out.<br>&nbsp;&nbsp;&nbsp;&nbsp; # XXX TODO this should be a validate_valid_values sub
<br>&nbsp;&nbsp;&nbsp;&nbsp; if ( $value &amp;&amp; $field_info-&gt;{valid_values} ) {<br><br>