Changed serializer and added new values to views
This commit is contained in:
parent
2544b3a4cc
commit
eea11ef5ba
@ -5,8 +5,8 @@ from .models import Migration
|
|||||||
|
|
||||||
|
|
||||||
class MigrationAdmin(admin.ModelAdmin):
|
class MigrationAdmin(admin.ModelAdmin):
|
||||||
list_display = ('migration_status', 'booked_time',
|
list_display = ('ticket_id', 'booked_date' , 'booked_time',
|
||||||
'ticket_id', 'domain', 'brand', 'print_missed_migrations')
|
'migration_status', 'domain', 'brand')
|
||||||
search_fields = ['domain', 'booked_time',
|
search_fields = ['domain', 'booked_time',
|
||||||
'username', 'ticket_id', 'migration_status']
|
'username', 'ticket_id', 'migration_status']
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ class MigrationOverView(serializers.ModelSerializer):
|
|||||||
model = Migration
|
model = Migration
|
||||||
fields = ['id',
|
fields = ['id',
|
||||||
'domain',
|
'domain',
|
||||||
|
'booked_date',
|
||||||
'booked_time',
|
'booked_time',
|
||||||
'migration_status',
|
'migration_status',
|
||||||
'term_date']
|
'term_date']
|
||||||
@ -16,6 +17,7 @@ class MigrationSerializer(serializers.ModelSerializer):
|
|||||||
fields = ['id',
|
fields = ['id',
|
||||||
'submit_time',
|
'submit_time',
|
||||||
'domain',
|
'domain',
|
||||||
|
'booked_date',
|
||||||
'booked_time',
|
'booked_time',
|
||||||
'original_server',
|
'original_server',
|
||||||
'new_server',
|
'new_server',
|
||||||
@ -28,4 +30,5 @@ class MigrationSerializer(serializers.ModelSerializer):
|
|||||||
'additional_domains',
|
'additional_domains',
|
||||||
'migration_type',
|
'migration_type',
|
||||||
'term_date',
|
'term_date',
|
||||||
'migration_cmd']
|
'migration_cmd',
|
||||||
|
'extra_scripts_run']
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class MigrationsBooked(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 = MigrationOverView(Migration.objects.filter(
|
migrations = MigrationSerializer(Migration.objects.filter(
|
||||||
migration_status="Booked",)[:limit], many=True)
|
migration_status="Booked",)[:limit], many=True)
|
||||||
return Response(migrations.data, status=status.HTTP_200_OK)
|
return Response(migrations.data, status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ SECRET_KEY = 'cq3daur*kk2+*-)@s%wq1c+pc7xi-c1ig@-%wq)m7pn3+zxbre'
|
|||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['10.6.9.42', 'benjamyn.love', 'localhost']
|
ALLOWED_HOSTS = ['10.6.9.32', 'benjamyn.love', 'localhost']
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@ -80,9 +80,9 @@ WSGI_APPLICATION = 'migratorapi.wsgi.application'
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME': 'devmigs',
|
'NAME': 'newDevAPI',
|
||||||
'USER': 'devmig',
|
'USER': 'devAPI',
|
||||||
'PASSWORD': 'XXgDh1i6w8rqp4BG',
|
'PASSWORD': 'Pat9Mnug2LO1SZMq',
|
||||||
'HOST': '127.0.0.1',
|
'HOST': '127.0.0.1',
|
||||||
'PORT': '3306',
|
'PORT': '3306',
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user