2021年1月3日星期日

What is the role of using two dashes here __year in the example below ? im new in learning django

Get the question that was published this year.

>>> from django.utils import timezone  >>> current_year = timezone.now().year  >>> Question.objects.get(pub_date__year=current_year)  <Question: What's up?>  
https://stackoverflow.com/questions/65556544/what-is-the-role-of-using-two-dashes-here-year-in-the-example-below-im-new-i January 04, 2021 at 09:03AM

没有评论:

发表评论