$ http http://10.10.3.70:8000/news/news/
HTTP/1.0 200 OK
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Date: Mon, 19 Sep 2016 12:55:32 GMT
Server: WSGIServer/0.2 CPython/3.5.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
[
{
"pk": 1,
"text": "Привет мир!",
"title": "Test"
},
{
"pk": 2,
"text": "Привет мир!3223232",
"title": "Test!!!!"
}
]
class IssueCustomManager(models.Manager):
@staticmethod
def list(user):
"""
:type user: request.user
:return: queryset
"""
if user.is_staff:
return Issue.objects.all()
else:
return Issue.objects.filter(user=user)