Hi!

See:
http://groups.google.com/group/web2py/browse_thread/thread/4eebaf795d43e171/7ba6a2e79e1db2bf?lnk=gst&q=composite+key#7ba6a2e79e1db2bf

On 29 mar, 19:12, luifran <lbernalhernan...@yahoo.es> wrote:
> I have not explained very well, I will not prevent the value of a and
> b are equal, I want to avoid the insertion of identical records, for
> example:
> Record 1 -> a: 4 b: 5
> Record 2 -> a: 4 b: 5
>
> This is what I want to avoid
> Sorry for my words, I'm Spanish, not fluent in English.
>
> On 28 mar, 20:40, luifran <lbernalhernan...@yahoo.es> wrote:
>
> > Thanks, I'll try that way
>
> > On Mar 28, 8:59 am, Massimo Di Pierro <massimo.dipie...@gmail.com>
> > wrote:
>
> > > db.define_table ('t', Field ('a'), Field ('b',requires=IS_EXPR('value!=
> > > %s'% repr(request.vars.a)))
>
> > > On Mar 28, 10:37 am, luifran <lbernalhernan...@yahoo.es> wrote:
>
> > > > I have the following table, for example:
> > > > db.define_table ('t', Field ('a '), Field ('b'))
> > > > I want to impose the following restriction, to avoid insertion of
> > > > duplicate records
> > > > not allow insertion of a pair of identical values (a y b)​​.
> > > > How I can do this?, I know how to restrict a single field, but not
> > > > both at once.
>
>

Reply via email to