1
年を置き換える:
mb = self.birthdate.replace(year=date.today.year)
それは、これを与える:ジャンゴ - これでDateTimeField型
Caught AttributeError while rendering: 'builtin_function_or_method' object has no attribute 'year'
年を交換することが可能でしょうか?
のですか?これは助けるかもしれないhttp://stackoverflow.com/questions/4093118/how-to-increment-the-year-on-a-datetimefield-in-django-with-update – dotty
年齢を数えるためにちょうど年を取り替える必要があります。データベースにセーブする必要はありません。 – krzyhub
生年月日は何ですか?それはdatetimeオブジェクトですか? –