Changed custom_methods model test/doc to add explanation of what Article(*row) means, for Python beginners

git-svn-id: http://code.djangoproject.com/svn/django/trunk@363 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-01 18:57:37 +00:00
parent b307fb09bb
commit a4438d74f6
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class Article(meta.Model):
FROM custom_methods_articles FROM custom_methods_articles
WHERE pub_date = %s WHERE pub_date = %s
AND id != %s""", [str(self.pub_date), self.id]) AND id != %s""", [str(self.pub_date), self.id])
# The asterisk in "Article(*row)" tells Python to expand the list into
# positional arguments to Article().
return [Article(*row) for row in cursor.fetchall()] return [Article(*row) for row in cursor.fetchall()]
API_TESTS = """ API_TESTS = """