mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-29 00:35:45 +08:00
Migrated location fields to new format. Also fixed student_status serializer
This commit is contained in:
parent
14d99fc7c2
commit
98177f7235
23 changed files with 69 additions and 221 deletions
|
@ -1,5 +1,6 @@
|
|||
# Generated by Django 4.2.2 on 2023-06-27 15:21
|
||||
# Generated by Django 4.2.3 on 2023-07-09 10:57
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
@ -19,8 +20,7 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=48)),
|
||||
('x', models.FloatField(null=True)),
|
||||
('y', models.FloatField(null=True)),
|
||||
('location', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
|
||||
('active', models.BooleanField(default=False)),
|
||||
('timestamp', models.DateField(auto_now_add=True)),
|
||||
('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.subject')),
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from django.db import models
|
||||
from subjects.models import Subject
|
||||
from django.contrib.gis.db import models as gis_models
|
||||
from django.contrib.gis.geos import Point
|
||||
# Create your models here.
|
||||
|
||||
|
||||
|
@ -7,8 +9,7 @@ class StudyGroup(models.Model):
|
|||
name = models.CharField(max_length=48)
|
||||
users = models.ManyToManyField(
|
||||
'student_status.StudentStatus', through='StudyGroupMembership')
|
||||
x = models.FloatField(null=True)
|
||||
y = models.FloatField(null=True)
|
||||
location = gis_models.PointField(blank=True, null=True)
|
||||
subject = models.ForeignKey(Subject, on_delete=models.CASCADE)
|
||||
active = models.BooleanField(default=False)
|
||||
timestamp = models.DateField(auto_now_add=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue