diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-09-08 11:00:04 -0400 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-09-08 11:00:04 -0400 |
| commit | e69348b4e7f07ef927edaecc7126901fc91c79d0 (patch) | |
| tree | e3bf89867455ee918f69245a3d4c7be5535ad155 /docs/topics/db/examples | |
| parent | b7d3b057f32ed6aa7ee0941e1f0dec9d3e9223a3 (diff) | |
Avoided mixing dates and datetimes in the examples.
Refs #16023.
Diffstat (limited to 'docs/topics/db/examples')
| -rw-r--r-- | docs/topics/db/examples/many_to_one.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/db/examples/many_to_one.txt b/docs/topics/db/examples/many_to_one.txt index 0a9978b8d1..c869362d16 100644 --- a/docs/topics/db/examples/many_to_one.txt +++ b/docs/topics/db/examples/many_to_one.txt @@ -42,8 +42,8 @@ Create a few Reporters:: Create an Article:: - >>> from datetime import datetime - >>> a = Article(id=None, headline="This is a test", pub_date=datetime(2005, 7, 27), reporter=r) + >>> from datetime import date + >>> a = Article(id=None, headline="This is a test", pub_date=date(2005, 7, 27), reporter=r) >>> a.save() >>> a.reporter.id @@ -65,7 +65,7 @@ database, which always returns unicode strings):: Create an Article via the Reporter object:: - >>> new_article = r.article_set.create(headline="John's second story", pub_date=datetime(2005, 7, 29)) + >>> new_article = r.article_set.create(headline="John's second story", pub_date=date(2005, 7, 29)) >>> new_article <Article: John's second story> >>> new_article.reporter @@ -75,7 +75,7 @@ Create an Article via the Reporter object:: Create a new article, and add it to the article set:: - >>> new_article2 = Article(headline="Paul's story", pub_date=datetime(2006, 1, 17)) + >>> new_article2 = Article(headline="Paul's story", pub_date=date(2006, 1, 17)) >>> r.article_set.add(new_article2) >>> new_article2.reporter <Reporter: John Smith> |
