Should Query.add_ordering() raise FieldError exception?

13 views
Skip to first unread message

Камиль Талипов

unread,
Jan 27, 2022, 9:02:41 AM1/27/22
to Django users
The add_ordering() method has a call to the names_to_path() function with the following comment:

# names_to_path() validates the lookup. A descriptive
# FieldError will be raise if it's not.
self.names_to_path(item.split(LOOKUP_SEP), self.model._meta)

(django.db.models.sql.query: ~1989 line)

Function names_to_path have optional fail_on_missing argument, but is don't pass  (== fail_on_missing=False) in call from add_ordering.

It's normal ?

It was added after the closed ticket https://code.djangoproject.com/ticket/31426

Камиль Талипов

unread,
Jan 27, 2022, 9:25:29 AM1/27/22
to Django users
pls, ignore this and next duplicate mail 
i already got answer  

четверг, 27 января 2022 г. в 17:02:41 UTC+3, Камиль Талипов:
Reply all
Reply to author
Forward
0 new messages