Changes between Initial Version and Version 1 of Ticket #32411, comment 8


Ignore:
Timestamp:
Feb 19, 2021, 6:53:58 AM (4 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32411, comment 8

    initial v1  
    11> the problem is the authors fields is a list and Django does not support filter it
    22
    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 `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].
     3That 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].
Back to Top