Is anyone having a problem displaying foreign key fields in the
admin?  If I include a foreign key in the list_display of the admin
model that controls my db model, it won't display any rows.  I did
some debug sleuthing and discovered if I commented out two lines (seen
below), everything displays fine.  I'm sure this isn't right now.
This worked on the 8th.  I updated to the latest svn today and this
came up.  Not sure what the deal is.

    def select_related(self, *fields, **kwargs):
        """
        Returns a new QuerySet instance that will select related
objects.

        If fields are specified, they must be ForeignKey fields and
only those
        related objects are included in the selection.
        """
        depth = kwargs.pop('depth', 0)
        if kwargs:
            raise TypeError('Unexpected keyword arguments to
select_related: %s'
                    % (kwargs.keys(),))
        obj = self._clone()
        import pdb
        pdb.set_trace()
        if fields:
            if depth:
                raise TypeError('Cannot pass both "depth" and fields
to select_related()')
            obj.query.add_select_related(fields)
        # else:
            # obj.query.select_related = True
        if depth:
            obj.query.max_depth = depth
        return obj

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to