Subclassing + Renaming

2010-02-20 Thread Calaganne
Hi there, I've some basic models like PERSON, GROUP and ROLE: class PERSON (models.Model): first = models.CharField ('first name', max_length=256) last = models.CharField ('last name', max_length=256) class GROUP (models.Model): name = models.CharField (max_length=256) members

Re: QuerySets - Reverse Look-Up for Index

2010-03-09 Thread Calaganne
Hey, thanx for the reply! No, the bid is *not* ordered randomly, but you know what, your solution works anyway! ;) Test this and you'll notice that it works.. (still haven't figured out why!): * bs = BID.objects.all () * idx=81; bid=bs[idx]; * bs.order_by ('?').filter (pk__lt=bid.id).count ()

Re: QuerySets - Reverse Look-Up for Index

2010-03-09 Thread Calaganne
Although it works in my interactive environment.. it does not work in my actual script.. ?? On Mar 9, 7:02 pm, Calaganne wrote: > Hey, > > thanx for the reply! No, the bid is *not* ordered randomly, but you > know what, your solution works anyway! ;) Test this and you'll notic