I'm not sure if this will work for you, but I'd simply create a
"helper" table and Django model for that and insert new entries there
to get the next number in the sequence. You might even find it useful
for storing other data such as when a certain number in the sequence
was generated and by whom etc.
class SequenceItem(models.Model):
created = models.DateTimeField(default=datetime.datetime.now)
author = models.ForeignKey(User)
Erik
On 29.08.2008, at 9:10, ydjango wrote:
>
> I need to create sequences and use them during runtime in django orm
> code. Mysql does not support external sequence.
> sequence name will be dynamically generated.
>
> I already have default id auto-increment fields in all tables, but
> this sequence which i need is not table level, so autofield will not
> work for me.
>
> Can i do it through django orm ? how?
>
> do I need to do custom query using DBI? Will standard postgresql
> syntax work or is there some special syntax.
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---