Custom Auto-Incrementing Columns

2008-05-13 Thread jwwest
Hi all, Is there a way to create a column that has a unique id per row like id, but where I can specify the number it starts from? Basically I'm working on a ecommerce system and I would like the sales order numbers to start from say, 1000. I'd use ID, but as far as I know, it starts from 1. - J

Empty Result set

2008-05-06 Thread jwwest
What's the preferred method of checking to see if a result set is empty in a view? For instance, I'm writing blog software and have a view by year method. If there are no posts, I want to raise a http404. I've tried == {} and == [] to no avail. Thanks, - James --~--~-~--~~--

Iterating through inner dictionaries

2008-04-22 Thread jwwest
I have a view that returns a dictionary containing several dictionaries. What's the proper way to iterate through each sub dictionary in a template? I tried a nested for, but I'm getting a template error saying that my top most dictionary is a long and is not iterable. - James --~--~-~--~

Re: Model Options for Admin Site

2008-04-21 Thread jwwest
Actually, NVM. Right after I asked this I found the answer in the Django Book. Thank you. - James On Apr 21, 5:07 pm, jwwest <[EMAIL PROTECTED]> wrote: > Wow, awesome. Thank you! > > On the same subject, is there a way to display more information on the > record in the listin

Re: Model Options for Admin Site

2008-04-21 Thread jwwest
   return self.name > > //Thomas > > Am 21.04.2008 um 23:55 schrieb jwwest: > > > > > Hey all, > > > I'm not sure what I'm doing wrong in my models file, but when I add a > > record in admin, all records are titled [name of model] object. This > >

Model Options for Admin Site

2008-04-21 Thread jwwest
Hey all, I'm not sure what I'm doing wrong in my models file, but when I add a record in admin, all records are titled [name of model] object. This is a problem especially in related tables since there's no way to tell them apart. What do I need to add and where? Thanks -James --~--~-~