From 93c16b0d5907b8e5d89c71ac422ea3bf8663cfb5 Mon Sep 17 00:00:00 2001 From: King Date: Fri, 13 Apr 2018 10:56:18 +0000 Subject: Update slides.md --- tutorial_6_django_shell_queries/slides.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorial_6_django_shell_queries/slides.md b/tutorial_6_django_shell_queries/slides.md index 92ae0a4..954cbff 100644 --- a/tutorial_6_django_shell_queries/slides.md +++ b/tutorial_6_django_shell_queries/slides.md @@ -74,7 +74,7 @@ Now let's add a new blog Explanation: - We create an instance of Blog and add values to it's fields (name and creation date) -- We then save the object, which means Django writes this information to the SQL table 'Blog' +- We then save the object, which means Django writes this information to the database table 'Blog' Now we access model field values via Python attributes. @@ -117,9 +117,9 @@ Lets add a custom method to the blog model def was_created_recently(self): return self.created_on >= timezone.now() - datetime.timedelta(days=1) -In shell: +In the shell: - >>> b2.was_created_recently() + >>> b.was_created_recently() Demonstration [01:30 | 05:14] -------------- @@ -140,7 +140,7 @@ Try sorting the Blog objects based on created_on year >>> current_year = timezone.now().year >>> Blog.objects.filter(created_on__year=current_year) -Explanation: This query will give all the blog instances with created_on year +Explanation: This query will give all the blog instances with created_on the current year Demonstration [01:00 | 06:14] -- cgit