Changes between Version 1 and Version 2 of Ticket #32411, comment 8
- Timestamp:
- Feb 19, 2021, 10:31:53 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32411, comment 8
v1 v2 1 1 > the problem is the authors fields is a list and Django does not support filter it 2 2 3 That little to do with this ticket though. The ORM has no way of ''knowing'' `authors` is a JSON Array because `JSONField` are schema less. If you want to filter out papers that have at least one author with a matching name you'll have to use the MySQL equivalent of PostgreSQL `json_array_elements` and a subquery through a `Func` expression but that's something you should ask about on [https://docs.djangoproject.com/en/3.1/faq/help/#how-do-i-do-x-why-doesn-t-y-work-where-can-i-go-to-get-help support channels].3 That has little to do with this ticket though. The ORM has no way of ''knowing'' `authors` is a JSON Array because `JSONField` are schema less. If you want to filter out papers that have at least one author with a matching name you'll have to use the MySQL equivalent of PostgreSQL `json_array_elements` and a subquery through a `Func` expression but that's something you should ask about on [https://docs.djangoproject.com/en/3.1/faq/help/#how-do-i-do-x-why-doesn-t-y-work-where-can-i-go-to-get-help support channels].