Functions, parameters

Boris Ozegovic silovana.vjeverica at com.gmail
Thu Feb 8 13:26:51 EST 2007


Hi, I'am still learning Python and while reading Django tutorial couldn't
understand this part:

class Poll(models.Model):
	question = models.CharField(maxlength=200)
	pub_date = models.DateTimeField('date published')


# Django provides a rich database lookup API that's entirely driven by
# keyword arguments.
>>> Poll.objects.filter(question__startswith='What')

This 'question__startswith' is the problem.  What is the common idiom for
this type od arguments, so I can Google it?  I understand what this filter
is suppose to do, but don't know how it is done (this separation of Poll
atribute and startwith function).

-- 
http://www.nacional.hr/articles/view/23894/23



More information about the Python-list mailing list