Django

Code

Changeset 363

Show
Ignore:
Timestamp:
08/01/05 13:57:37 (3 years ago)
Author:
adrian
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/testapp/models/custom_methods.py

    r336 r363  
    4949            WHERE pub_date = %s 
    5050                AND id != %s""", [str(self.pub_date), self.id]) 
     51        # The asterisk in "Article(*row)" tells Python to expand the list into 
     52        # positional arguments to Article(). 
    5153        return [Article(*row) for row in cursor.fetchall()] 
    5254