On Mon, Jun 29, 2009 at 10:27 AM, huu...@gmail.com <huu...@gmail.com> wrote:
> > I'd like to use values_list() to populate a choices attribute. > However, I need to access some foreign-keyed properties to properly > display the information. > > For example: > > >> Books.objects.values_list('id', 'author__name') > > Currently, it doesn't appear to be working. It works for me: Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from crossword.models import Puzzles >>> Puzzles.objects.values_list('date', 'publisher__editor')[22] (datetime.date(2009, 6, 24), u'Rich Norris/Joyce Nichols Lewis') What do you get? What were you expecting instead? Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---