gabor wrote:
> hi,
> 
> imagine 2 simple models like:
> 
> 
> =====================
> class Thing(Model):
>      name = CharField(maxlength=500)
> =====================
> 
> 
> =====================
> class Owner(Model):
>      name = CharField(maxlength=500)
>      thing = ForeignKey(Thing)
> =====================
> 
> now let's say you have 20000 Thing objects.
> 
> everything is ok, until you call
> 
> Owner.AddManipulator()... this will take a looooooooong time.
> 
> i think it's because somehow the AddManipulator goes through all the 
> 20000 Thing objects. i have no idea why btw. why would he need it at 
> this point? i can understand him needing it when the formwrapper wants 
> to render the  field as a selectbox, but for the rest of time...why?
> 


ok, to make a long story short,
you need to use the raw_id_admin = True flag in the ForeignKey,
and all will be fine.

it's also in the documentation (model_api), but what's not mentioned is 
that not only works in the admin-interface, but also globally.

apologies to the django-team for assuming that they did not solve this 
isse :-)

gabor

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to