Re: A modeling/implementation quiz

2008-04-21 Thread Rajesh Dhawan
On Apr 19, 3:29 pm, Juanjo Conti <[EMAIL PROTECTED]> wrote: > Hi all, > > I am worried about how to model the next scene (this is an example, but > an appropriated one): In the model we have People, and there are > different kind of people, let's say: Professors, Students and Other. > Each Peopl

Re: A modeling/implementation quiz

2008-04-21 Thread Juanjo Conti
Kenneth Gonsalves escribió: > > On 21-Apr-08, at 8:15 PM, Michael wrote: > >> What about using the count() method on a filtered subset to get your >> id? >> >> Eg: >> p = People(type="S") >> p.id = People.objects.filter(type=p.type).count() + 1 > > I dont know what the context of this is, b

Re: A modeling/implementation quiz

2008-04-21 Thread Kenneth Gonsalves
On 21-Apr-08, at 8:15 PM, Michael wrote: > What about using the count() method on a filtered subset to get your > id? > > Eg: > p = People(type="S") > p.id = People.objects.filter(type=p.type).count() + 1 I dont know what the context of this is, but this would only give the id if you have

Re: A modeling/implementation quiz

2008-04-21 Thread Michael
What about using the count() method on a filtered subset to get your id? Eg: p = People(type="S") p.id = People.objects.filter(type=p.type).count() + 1 Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: A modeling/implementation quiz

2008-04-19 Thread Juanjo Conti
andy baxter escribió: > Is there a strong reason why the count should depend on the type? Yes, I am creating a system for a real state business where this code schema is used for the different type of houses. Juanjo -- mi blog: http://www.juanjoconti.com.ar --~--~-~--~~--

Re: A modeling/implementation quiz

2008-04-19 Thread andy baxter
Juanjo Conti wrote: > Hi all, > > I am worried about how to model the next scene (this is an example, but > an appropriated one): In the model we have People, and there are > different kind of people, let's say: Professors, Students and Other. > Each People object has a 'type' attribute. Type c