API: started work, added a serializer

This commit is contained in:
Никита Тырин 2024-09-17 11:37:03 +03:00
parent c6df41f903
commit 7a18b1b2ff
4 changed files with 80 additions and 2 deletions

View File

@ -11,7 +11,7 @@ from datetime import datetime, timedelta
import gc
import json
MAX_WORKERS = 2 * mp.cpu_count() - 1 #max number of workers for multiprocessing
MAX_WORKERS = 8 #max number of workers for multiprocessing
CHUNK_SIZE = 1_000 #size of individual chunk
def current_time(): #a function for timestamps

View File

@ -0,0 +1,65 @@
# Generated by Django 5.1.1 on 2024-09-17 08:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('GaiaDBInterface', '0005_remove_catalogfile_nested_indexed_and_more'),
]
operations = [
migrations.RemoveField(
model_name='gaiasource',
name='designation',
),
migrations.RemoveField(
model_name='gaiasource',
name='parallax',
),
migrations.RemoveField(
model_name='gaiasource',
name='parallax_error',
),
migrations.RemoveField(
model_name='gaiasource',
name='phot_bp_mean_mag',
),
migrations.RemoveField(
model_name='gaiasource',
name='phot_g_mean_mag',
),
migrations.RemoveField(
model_name='gaiasource',
name='phot_rp_mean_mag',
),
migrations.RemoveField(
model_name='gaiasource',
name='pmdec',
),
migrations.RemoveField(
model_name='gaiasource',
name='pmdec_error',
),
migrations.RemoveField(
model_name='gaiasource',
name='pmra',
),
migrations.RemoveField(
model_name='gaiasource',
name='pmra_error',
),
migrations.RemoveField(
model_name='gaiasource',
name='ref_epoch',
),
migrations.RemoveField(
model_name='gaiasource',
name='solution_id',
),
migrations.RemoveField(
model_name='gaiasource',
name='source_id',
),
]

7
serializers.py Normal file
View File

@ -0,0 +1,7 @@
from rest_framework import serializers
from .models import GaiaSource
class GaiaSourceSerializer(serializers.ModelSerializer):
class Meta:
model = GaiaSource
fields = '__all__'

View File

@ -1 +1,7 @@
from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from .models import GaiaSource
from .serializers import GaiaSourceSerializer