>
Jo...@email.com <
wanpeng.y...@gmail.com>")
> >>>p.save()
>
> I already have a trigger in oracle to insert the instructorid, the
> fingerprint and timestamp. However, when I type:
>
> >>>p.instructorid
>
> It returns null while it should return a new instructorid. If I change the
> model type of instructorid to AutoField, I get the 'Cannot find sequence'
> error when using p.save() , but I do have the sequence and trigger.
>
> I tried to create a new model in django and let django create the table for
> me in oracle. I don't have the same problem as with the existing tables.
>
> So how can I let django know 'I already have sequences and triggers, use
> them!' ?
>
> Thank you.
Hi Wanpeng,
Unfortunately, the Oracle backend doesn't currently offer a way to
specify an alternative name for the sequence. However, in Django 1.1
we have changed the way AutoField values are retrieved to use a
"RETURNING" clause, which in addition to being more efficient does not
require knowledge of the sequence name. I would suggest upgrading to
the latest trunk version if possible.
If upgrading is not an option, then I suggest creating a synonym for
the sequence with the name Django expects for the sequence. This is
normally the name of the table plus "_SQ", unless that would be longer
than the allowed 30 characters.
Hope this helps,
Ian