mirror of https://github.com/django/django.git
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:
parent
b307fb09bb
commit
a4438d74f6
|
@ -48,6 +48,8 @@ class Article(meta.Model):
|
|||
FROM custom_methods_articles
|
||||
WHERE pub_date = %s
|
||||
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()]
|
||||
|
||||
API_TESTS = """
|
||||
|
|
Loading…
Reference in New Issue