when I use this method, I can only use its id, So how can it show related 
model's field which has been defined in __str__

On Tuesday, February 17, 2015 at 3:20:22 PM UTC+8, Jani Tiainen wrote:
>
> On Mon, 16 Feb 2015 15:03:05 -0800 (PST) 
> Jani Kajala <kaj...@gmail.com <javascript:>> wrote: 
>
> > Hi all, 
> > 
> > I have tons of objects referenced by ForeignKey in Django Admin module 
> UI, 
> > and I would like to replace it with something more optimal, e.g. 
> auto-fill 
> > input box or something. 
> > 
> > My model looks something like this: 
> > 
> > class SoapCall(models.Model): 
> >     customer = models.ForeignKey(Customer, null=True, blank=True) 
> >     created = models.DateTimeField(default=now) 
> >     wsdl = models.CharField(max_length=255) 
> >     func = models.CharField(max_length=63) 
> >     request = models.TextField() 
> >     response = models.TextField() 
> > 
> > Now, this works great, but if I have 100000 Customer objects it's not 
> very 
> > nice to generate one huge <select><option>... element for every page 
> load. 
> > 
> > There seems to be many possible plugins/implementations for this, but I 
> was 
> > just wondering if anyone would have up-to-date recommendations in this 
> > mailing list. I'm on Python 3.4.2 and Django 1.7.4. 
>
> I would start with built-in implementation, a.k.a. rawid_id_fields <
> https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields>
>  
>
>
>
> -- 
> Jani Tiainen 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d669c0e2-ec77-489e-86dd-6fbb31929f1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to