On Fri, Jul 1, 2011 at 1:20 AM, Bruno Rocha <[email protected]> wrote:

> Db.define_table('foo',Field('a'),Field('b'), Field('ab',unique=True,
> compute=lambda r: r.a + r.b))
>
This failed for me with sqlite and I see from other discussions that the
same is true with Django - sqlite throws an error that it cannot create a
unique field.

However, it seems to work fine with MySQL; it did create a unique index on
the column.  I wasn't really planning to use sqlite, anyway, just thought
I'd keep things simpler at first.  I just switched to MySQL now and it's
working fine.

Thanks for the help.

Nick

Reply via email to