python - why slicing django queryset return a list -
i have queryset derived piece of code, called objs. print both type(objs) , type(objs[0:10]) in same print function follows:
print(type(objs), type(objs[0:10]))
the results show type(objs) queryset. type(objs[0:10]) list
but when lookup django document, second 1 should queryset. possible reasons this?
slicing
queryset
has been evaluated returns list.
if slice unevaluated queryset
, you'll queryset
(as long don't use "step" parameter of slice syntax).
Comments
Post a Comment