Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 20:45 -0700, K*K wrote: > Let me show you some data in database, you will understand it. No, because that wasn't the question I was asking. I wasn't having problems understanding the models. I was asking why you have to do one query per Plan instance, instead of all together

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread K*K
Let me show you some data in database, you will understand it. mysql> select * from plans where plan_id = 184; +-+---+-+---+ | plan_id | name | create_date | author_id | +-+---+-+-

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 19:22 -0700, K*K wrote: > Are there some other solution of it ? I still don't understand the problem. > > The more than 2000 queries is from the get_latest_text() function, it > will be generate one query each plan. I have more than 2000 plans so > it will generate more th

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread K*K
Yeah, I wrote the SQL before, but the requirements writer is a ex- Turbogears developer, and he said it can be implemented with SQLAlchemy. -_-# So the SQL code was deleted by him in early days. On Mar 10, 10:25 am, Alex Gaynor wrote: > On Mon, Mar 9, 2009 at 9:22 PM, K*K wrote: > > > Are th

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread K*K
Heh, I will agree with you if I am the boss. :-) But I hope the ORM of Django will be powerful enough for difference requirements more. On Mar 9, 6:59 pm, James Bennett wrote: > On Mon, Mar 9, 2009 at 4:47 AM, K*K wrote: > > Because the > > requirements wrote all of database code should implem

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 9:22 PM, K*K wrote: > > Are there some other solution of it ? > > The more than 2000 queries is from the get_latest_text() function, it > will be generate one query each plan. I have more than 2000 plans so > it will generate more than 2000 queries. > > def get_latest_text(

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread K*K
Are there some other solution of it ? The more than 2000 queries is from the get_latest_text() function, it will be generate one query each plan. I have more than 2000 plans so it will generate more than 2000 queries. def get_latest_text(self): try: tptxt = PlanTexts.objects

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread James Bennett
On Mon, Mar 9, 2009 at 4:47 AM, K*K wrote: > Because the > requirements wrote all of database code should implemented with ORM > code and can not use RAW SQL, and the interactive designer do not want > to make concession. The person responsible for this decision should be fired, incidentally: te

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 02:47 -0700, K*K wrote: > I'm porting a old system to Django architecture. The database schema > can not be modified because the data was existed. The new system will > running with the old system at the beginning but will run standalone > in the future. > > The system have

Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread K*K
I'm porting a old system to Django architecture. The database schema can not be modified because the data was existed. The new system will running with the old system at the beginning but will run standalone in the future. The system have two tables, which one is plan and another is plan_text, pl