Django

Code

Ticket #4876 (closed: invalid)

Opened 1 year ago

Last modified 1 year ago

typo error

Reported by: james_027@yahoo.com Assigned to: jacob
Milestone: Component: Documentation
Version: 0.96 Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

def was_published_today(self):

return self.pub_date.date() == datetime.today()

instead of

return self.pub_date.date() == datetime.date.today()

Attachments

Change History

07/14/07 12:37:03 changed by John Shaffer <jshaffer2112@gmail.com>

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to invalid.
  • needs_tests changed.
  • needs_docs changed.

This example code is in tutorials 1 and 2.

There's no error here. You may have used "from datetime import datetime" rather than "import datetime". The Python shell examples use the first import, but the models file should use the second. They could be normalized to avoid this confusion, but that's a separate issue.


Add/Change #4876 (typo error)




Change Properties
Action