> Den 15/05/2015 kl. 20.54 skrev Timothy W. Cook <t...@mlhim.org>:
> 
>  def formfield_for_many_to_many(self, db_field, *args, **kwargs):
>         formfield = super(ClusterAdmin, 
> self).formfield_for_many_to_many(db_field, *args, **kwargs)
>         if db_field.name in 
> ['cluster','dvboolean','dvuri','dvstring','dvcodedstring','dvidentifier','dvparsable','dvmedia',
>                              
> 'dvordinal','dvcount','dvquantity','dvratio','dvtemporal']:
>             formfield.queryset = formfield.queryset.select_related('project')
>         return formfield

I just noticed you have a typo:

    if db_field.name in ['cluster', ...

should be:

    if db_field.name in ['clusters', ...

according to your model definition.

Erik

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ED7D33CB-EE4B-451D-B00F-7B24BFAD7A90%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to