Hi,

I'm rather new to Django (and webapp development) and I'd appreciate
any advice on the following problem.

I've a model named 'document' that can hold any kind of documents like
customer invoices, supplier invoices, goods returned, ..., but I've to
ensure that the customer invoices be numbered in sequence regardless
of the fact that there may be one customer invoice entered in the
system and then some supplier invoices and then again some customer
invoices. I've also a model holding the 'document type'. That model
could hold an Integer Field that is incremented at the creation of
every document type separately, but that has to be done in a
transaction together with the document creation:

begin-transaction
    document_type['customer invoice'].number += 1
    d = document(number = document_type['customer invoice'].number,
document_type = 'customer invoice', ...
    ...
end-transaction

Is that kind of mechanism working? Do you have any other suggestion?

Kind regards
Marc
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to