Compare commits
2 Commits
08cbbb7ba7
...
7a3c23c2ac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a3c23c2ac | ||
|
|
fc179ed2c8 |
@ -27,6 +27,7 @@ class Migration(models.Model):
|
|||||||
'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)
|
migration_cmd = models.CharField(max_length=200, null=True, blank=True)
|
||||||
is_urgent = models.BooleanField(default=False)
|
is_urgent = models.BooleanField(default=False)
|
||||||
|
# extra_scripts_run = models.BooleanField(default=False)
|
||||||
|
|
||||||
def print_missed_migrations(self):
|
def print_missed_migrations(self):
|
||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
|
|||||||
@ -20,13 +20,20 @@ def checkLimit(limit):
|
|||||||
else:
|
else:
|
||||||
limit = int(limit)
|
limit = int(limit)
|
||||||
return limit
|
return limit
|
||||||
|
|
||||||
|
def getAllMigrations(limit):
|
||||||
|
return Migration.objects.all()[:limit]
|
||||||
|
|
||||||
|
def getFilteredMigrations(limit, **kwargs):
|
||||||
|
pass
|
||||||
|
|
||||||
class MigrationList(APIView):
|
class MigrationList(APIView):
|
||||||
'''
|
'''
|
||||||
Returns a list of migrations with simpleData
|
Returns a list of migrations with simpleData
|
||||||
'''
|
'''
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
limit = checkLimit(request.GET.get('limit', ''))
|
limit = checkLimit(request.GET.get('limit', ''))
|
||||||
migrations = Migration.objects.all()[:limit]
|
migrations = getAllMigrations(limit)
|
||||||
serializer = MigrationOverView(migrations, many=True)
|
serializer = MigrationOverView(migrations, many=True)
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
@ -132,6 +139,6 @@ class PendingTerm(APIView):
|
|||||||
class MigrationListAll(APIView):
|
class MigrationListAll(APIView):
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
limit = checkLimit(request.GET.get('limit', ''))
|
limit = checkLimit(request.GET.get('limit', ''))
|
||||||
migrations = Migration.objects.all()[:limit]
|
migrations = getAllMigrations(limit)
|
||||||
serializer = MigrationSerializer(migrations, many=True)
|
serializer = MigrationSerializer(migrations, many=True)
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|||||||
Reference in New Issue
Block a user