Thanks Guys,
Will, your snippet was exactly what I was looking for - thanks for
that. Alas Rama, the client has specified that these custom Invoice
IDs get saved in the db alongside the primary key, otherwise I'd go
with your suggestion (simpler!)
On Feb 5, 8:27 am, Rama Vadakattu
CUSTOM_ID---ID
~
INV1 -- 1
INV2 ---2
INV33
.
.
.
i think you need INV1 for display purposes and also i hope it does
not matter much whether you store 1 or
There's no easy solution without saving the object to the database.
Auto incrementing fields (AutoField or just id) get their value from
the database, so they wont have one until you save. This is good
because it prevents multiple objects ever having the same value. One
way to do what you want is
Hey,
I want to add a field to an invoice model that contains a custom auto-
incrementing value in the format - 'INV01" which increments...
INV02 (obviously!). Anyone have a simple way I can build that
into the model when a user clicks 'Add New Invoice'? I've written
custom save methods
4 matches
Mail list logo