Re: How do I add a Custom ID Field that increments?

2009-02-09 Thread Alfonso
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

Re: How do I add a Custom ID Field that increments?

2009-02-05 Thread 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

Re: How do I add a Custom ID Field that increments?

2009-02-02 Thread Will Hardy
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

How do I add a Custom ID Field that increments?

2009-02-02 Thread Alfonso
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