Skip to content

Update README.md#1895

Closed
heit0r wants to merge 1 commit intoDjangoGirls:masterfrom
heit0r:patch-1
Closed

Update README.md#1895
heit0r wants to merge 1 commit intoDjangoGirls:masterfrom
heit0r:patch-1

Conversation

@heit0r
Copy link
Copy Markdown

@heit0r heit0r commented Apr 13, 2026

This was a mistake. Sorry

`created_date` seems to be updated:

>>> Post.objects.order_by('created_date')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/mojo/Python/CursoDjango/dgtut/.venv/lib/python3.12/site-
packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mojo/Python/CursoDjango/dgtut/.venv/lib/python3.12/site-
packages/django/db/models/query.py", line 1772, in order_by
    obj.query.add_ordering(*field_names)
  File "/home/mojo/Python/CursoDjango/dgtut/.venv/lib/python3.12/site-
packages/django/db/models/sql/query.py", line 2343, in add_ordering
    self.names_to_path(item.split(LOOKUP_SEP), self.model._meta)
  File "/home/mojo/Python/CursoDjango/dgtut/.venv/lib/python3.12/site-
packages/django/db/models/sql/query.py", line 1842, in names_to_path
    raise FieldError(
django.core.exceptions.FieldError: Cannot resolve keyword 'created_dat
e' into field. Choices are: author, author_id, create_date, id, publis
hed_date, text, title
>>> Post.objects.order_by('create_date')                   
<QuerySet [<Post: Sample title>, <Post: Second inline post>, <Post: Th
ird inline post>, <Post: Fourth inline post>]>
>>> Post.objects.order_by('-create_date')
<QuerySet [<Post: Fourth inline post>, <Post: Third inline post>, <Pos
t: Second inline post>, <Post: Sample title>]>
>>>
@heit0r heit0r closed this by deleting the head repository Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant