On Mon, 2008-04-14 at 08:22 -0700, Kevin Cole wrote: > Hi, > > I'm following along in the book, and noticed that when "ordering" is > used in the Meta class (Chapter 5, page 77) it is a list. However, > later, when used in the Admin class (Chapter 6, page 91), it's a > tuple.
Both work. > Testing it out, it seems to work okay either way, but I wondered if > there was a good reason to have Meta one way and Admin the other. Is > there a "best practice" here? (Or was it simply a typo in the book?) Meh. Either one works, so it doesn't really matter. The only slight difference is that if you have a single ordering item, a single item list is less error prone that a single item tuple. People keep forgetting that a single item tuple *must* have a trailing comma. So you'll often see cases of using ['foo'] instead of ('foo',) Regards, Malcolm -- If you think nobody cares, try missing a couple of payments. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---