mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-01 01:52:02 +00:00
11 lines
360 B
Python
11 lines
360 B
Python
from utils.api import APIView
|
|
|
|
from announcement.models import Announcement
|
|
from announcement.serializers import AnnouncementSerializer
|
|
|
|
|
|
class AnnouncementAPI(APIView):
|
|
def get(self, request):
|
|
announcements = Announcement.objects.filter(visible=True)
|
|
return self.success(self.paginate_data(request, announcements, AnnouncementSerializer))
|