更新时间:2022-12-11 16:55:45
您正在寻找的Django Rest Framework文档的一部分是在过滤e网址。
The part of the Django Rest Framework docs you're looking for is that on filtering against the URL.
基本思想是覆盖 get_queryset
以返回您在URL conf中定义的过滤的QuerySet匹配参数。
The basic idea is that you override get_queryset
to return a filtered QuerySet matching parameters you define in your URL conf.
您需要的Django ORM字段查找是 year
, month
和 day
,这从这里开始在QuerySet API参考中。
The Django ORM field lookups you'll need are year
, month
and day
, which start here in the QuerySet API reference.
我希望有所帮助。