resolve comments
This commit is contained in:
parent
028b8475b7
commit
a0a6e98fa6
|
|
@ -7,9 +7,6 @@ from utils.permissions import IsCommentModerator
|
||||||
|
|
||||||
class CommentLstView(generics.ListCreateAPIView):
|
class CommentLstView(generics.ListCreateAPIView):
|
||||||
"""Comment list create view."""
|
"""Comment list create view."""
|
||||||
serializer_class = CommentBaseSerializer
|
|
||||||
# permission_classes = [permissions.IsAuthenticatedOrReadOnly| IsCommentModerator|IsCountryAdmin]
|
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
from product.models import Product
|
from product.models import Product
|
||||||
from establishment.models import Establishment
|
from establishment.models import Establishment
|
||||||
|
|
@ -28,7 +25,10 @@ class CommentLstView(generics.ListCreateAPIView):
|
||||||
model = allowed[self.kwargs["type"]]
|
model = allowed[self.kwargs["type"]]
|
||||||
qs = qs.by_content_type(self.kwargs["type"], model)
|
qs = qs.by_content_type(self.kwargs["type"], model)
|
||||||
|
|
||||||
return qs.extra(order_by=['-created'])
|
return qs.order_by('-created')
|
||||||
|
|
||||||
|
serializer_class = CommentBaseSerializer
|
||||||
|
# permission_classes = [permissions.IsAuthenticatedOrReadOnly| IsCommentModerator|IsCountryAdmin]
|
||||||
|
|
||||||
|
|
||||||
class CommentRUDView(generics.RetrieveUpdateDestroyAPIView):
|
class CommentRUDView(generics.RetrieveUpdateDestroyAPIView):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user