This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from SELab-2/development
🚀 Release
- Loading branch information
Showing
140 changed files
with
6,246 additions
and
686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
backend/drtrottoir/migrations/0016_visit_schedule_waste_action_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Generated by Django 4.1.7 on 2023-04-13 14:06 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('drtrottoir', '0015_alter_customuser_buildings'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='visit', | ||
name='schedule', | ||
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='drtrottoir.schedule', verbose_name='schedule linked to visit'), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='waste', | ||
name='action', | ||
field=models.CharField(default=0, max_length=256, verbose_name='Action required'), | ||
preserve_default=False, | ||
), | ||
migrations.AlterField( | ||
model_name='buildingintour', | ||
name='building', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='drtrottoir.building', verbose_name='id of building'), | ||
), | ||
migrations.AlterField( | ||
model_name='schedule', | ||
name='student', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='id of user'), | ||
), | ||
migrations.AlterField( | ||
model_name='visit', | ||
name='user', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='id of user'), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
backend/drtrottoir/migrations/0017_alter_photo_created_at.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.7 on 2023-04-18 14:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('drtrottoir', '0016_visit_schedule_waste_action_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='photo', | ||
name='created_at', | ||
field=models.DateTimeField(null=True, verbose_name='time of creation'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
from .user_permissions import SuperPermission, SuperPermissionOrReadOnly, AdminPermissionOrReadOnly | ||
from .user_permissions import ( | ||
SuperPermission, | ||
SuperPermissionOrReadOnly, | ||
AdminPermissionOrReadOnly, | ||
SuperStudentPermissionOrReadOnly, | ||
AnyonePostSuperEditPermission, | ||
UserViewSetPermission, | ||
PhotoPermission, | ||
) | ||
|
||
__all__ = [SuperPermission, SuperPermissionOrReadOnly, AdminPermissionOrReadOnly] | ||
__all__ = [ | ||
SuperPermission, | ||
SuperPermissionOrReadOnly, | ||
AdminPermissionOrReadOnly, | ||
SuperStudentPermissionOrReadOnly, | ||
AnyonePostSuperEditPermission, | ||
UserViewSetPermission, | ||
PhotoPermission | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
from .region_factory import RegionFactory | ||
from .user_factory import DeveloperUserFactory | ||
from .user_factory import ( | ||
DeveloperUserFactory, | ||
SuperAdminUserFactory, | ||
SuperStudentUserFactory, | ||
OwnerUserFactory, | ||
StudentUserFactory | ||
) | ||
from .visit_factory import VisitFactory | ||
from .photo_factory import PhotoFactory | ||
from .waste_factory import WasteFactory | ||
from .tour_factory import TourFactory | ||
from .building_factory import BuildingFactory | ||
from .building_in_tour_factory import BuildingInTourFactory | ||
from .schedule_factory import ScheduleFactory | ||
|
||
__all__ = [ | ||
RegionFactory, | ||
DeveloperUserFactory, | ||
SuperAdminUserFactory, | ||
SuperStudentUserFactory, | ||
OwnerUserFactory, | ||
StudentUserFactory, | ||
BuildingFactory, | ||
VisitFactory, | ||
PhotoFactory, | ||
TourFactory, | ||
WasteFactory, | ||
TourFactory, | ||
BuildingInTourFactory | ||
BuildingInTourFactory, | ||
ScheduleFactory, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import random | ||
from factory.django import DjangoModelFactory | ||
import factory | ||
from django.utils import timezone | ||
from drtrottoir.models import Photo | ||
from .visit_factory import VisitFactory | ||
|
||
|
||
class PhotoFactory(DjangoModelFactory): | ||
image = factory.Faker("image_url") | ||
visit = factory.SubFactory(VisitFactory) | ||
state = random.choice([0, 1, 2]) | ||
state = random.choice([1, 2, 3]) | ||
comment = factory.Faker("sentence") | ||
created_at = factory.Faker("date_time", tzinfo=timezone.utc) | ||
|
||
class Meta: | ||
model = Photo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ class RegionFactory(DjangoModelFactory): | |
|
||
class Meta: | ||
model = Region | ||
django_get_or_create = ('region_name',) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from factory.django import DjangoModelFactory | ||
import factory | ||
from drtrottoir.models import Schedule | ||
from .user_factory import StudentUserFactory | ||
from .tour_factory import TourFactory | ||
|
||
|
||
class ScheduleFactory(DjangoModelFactory): | ||
date = date = factory.Faker("date") | ||
student = factory.SubFactory(StudentUserFactory) | ||
tour = factory.SubFactory(TourFactory) | ||
comment = factory.Faker("sentence") | ||
|
||
class Meta: | ||
model = Schedule |
Oops, something went wrong.