[GO] order_by ('-created_at') ← What is "ー"? ?? ?? [Beginner learns python with a reference book]

Introduction

Using Takashi Otaka, "Learning by Moving! Introduction to Python Django Development" I'm a beginner who started learning python and Django.

I've been studying programming for about 4 months using ruby / rails, When I changed jobs as an engineer, I decided to use python, so I started studying with this book in my hand.

Since I am a de-class amateur, I would be very grateful if you could comment on supplements and suggestions.

Overview

[Reference book applicable part] Chapter11 08 Add Pagination to Diary List Page (Kindle Position No.3995) List 11.11

[Clogged point]

order_by('-created_at')

What does'-created_at' mean? ??

result

It seems to represent ascending order and descending order. Surprising for ASC and DISC.

↓ Ascending order (old date → new date)

order_by('created_at')

↓ Descending order (new date → old date)

order_by('-created_at')

References

Takashi Otaka, "Learn by Moving! Introduction to Python Django Development"

Recommended Posts

order_by ('-created_at') ← What is "ー"? ?? ?? [Beginner learns python with a reference book]
[Python] What is a with statement?
What is God? Make a simple chatbot with python
What is a python map?
[Python] What is a zip function?
A story that I wanted to do a function like before_action used in rails with django [Beginner learns python with a reference book]
Spiral book in Python! Python with a spiral book! (Chapter 14 ~)
What is a dog? Python installation volume
What I did with a Python array
What is python
What are you comparing with Python is and ==?
Solve "AtCoder version! Ant book (beginner)" with Python!
Tell me what a conformal map is, Python!
What is Python
I made a Twitter BOT with GAE (python) (with a reference)
[Let's play with Python] Make a household account book
Basics of Python learning ~ What is a string literal? ~
To myself as a Django beginner (2) --What is MTV?
A story that I wanted to display the division result (%) on HTML with an application using django [Beginner learns python with a reference book in one hand]
What is a distribution?
[Python] What is Pipeline ...
What is a terminal?
What is a hacker?
What is a pointer?
[Python] What is virtualenv
[Python] What is a tuple? Explains how to use without tuples and how to use it with examples.
[python] Reverse with slices! !! (There is also a commentary on slices!)
A memo when face is detected with Python + OpenCV quickly
I made a simple book application with python + Flask ~ Introduction ~
A story about a python beginner stuck with No module named'http.server'
[Python] What is a slice? An easy-to-understand explanation of how to use it with a concrete example.
What is a decision tree?
Python list is not a list
What is a Context Switch?
Make a fortune with Python
[Python] Python and security-① What is Python?
What is a super user?
[Python] * args ** What is kwrgs?
What is a system call
[Definition] What is a framework?
Web scraping beginner with python
Create a directory with python
What is a callback function?
Python Basic Course (1 What is Python)
A note on what you did to use Flycheck with Python
If a beginner learns R or Python this December 2019, which one?
Pass a list by reference from Python to C ++ with pybind11
How to utilize Python with Jw_cad (Part 1 What is external transformation)
A memo for when pip3 is installed with python2.7 for some reason
I used Python with the minimum necessary knowledge, but I bought a reference book and studied again to summarize what I learned new and what I found useful.