Added completed
This commit is contained in:
parent
e858caf981
commit
9edc5f5042
@ -25,6 +25,7 @@ class Migration(models.Model):
|
|||||||
migration_type = models.CharField(max_length=200)
|
migration_type = models.CharField(max_length=200)
|
||||||
term_date = models.DateField(
|
term_date = models.DateField(
|
||||||
'Date to be terminated', null=True, blank=True)
|
'Date to be terminated', null=True, blank=True)
|
||||||
|
migration_cmd = models.CharField(max_length=200, null=True, blank=True)
|
||||||
is_urgent = models.BooleanField(default=False)
|
is_urgent = models.BooleanField(default=False)
|
||||||
|
|
||||||
def print_missed_migrations(self):
|
def print_missed_migrations(self):
|
||||||
|
|||||||
@ -44,6 +44,13 @@ class MigrationViewSet(viewsets.ModelViewSet):
|
|||||||
migration_status="booked",), many=True)
|
migration_status="booked",), many=True)
|
||||||
return Response(queryset.data, status=status.HTTP_200_OK)
|
return Response(queryset.data, status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
@action(detail=False, methods=['GET'])
|
||||||
|
def completed(self, request):
|
||||||
|
''' Returns a list of the booked migrations '''
|
||||||
|
queryset = MigrationSerializer(Migration.objects.filter(
|
||||||
|
migration_status="compelted",), many=True)
|
||||||
|
return Response(queryset.data, status=status.HTTP_200_OK)
|
||||||
|
|
||||||
@action(detail=False, methods=['GET'])
|
@action(detail=False, methods=['GET'])
|
||||||
def awaitterm(self, request):
|
def awaitterm(self, request):
|
||||||
''' Returns migrations awaiting termination '''
|
''' Returns migrations awaiting termination '''
|
||||||
|
|||||||
Reference in New Issue
Block a user