Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Should not be merged yet - TryIT [2021] covid edition #200

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions TryIT/settings_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

# MY VARS

ACTIVITIES = False
ACTIVITIES = True
WORKSHOPS = False
CONTESTS = False
LAST_EDITIONS = True
LANDING = False
STATS = False
EDITION_YEAR = 2020
STATS = True
EDITION_YEAR = 2021
TICKETS_SALE = True
PRIZES_ACTIVE = False
REGISTER_VOLUNTEERS = True
REGISTER_VOLUNTEERS = False
REGISTER_COMPANIES = False
PRIZES_ACTIVE = False
HASHCODE = False
Expand Down Expand Up @@ -62,8 +62,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')]
,
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -111,5 +110,3 @@
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
]
}


3 changes: 3 additions & 0 deletions TryIT/settings_secret.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PRIZE_PASSWORD = ""
BLOCKCHAIN_BACKEND = ""
ZOOM_MEETING_LINK = ""
4 changes: 3 additions & 1 deletion congress/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.contrib import admin

# Register your models here.
from congress.models import Streaming
from congress.models import AttendanceSlot, Streaming, Attendance

admin.site.register(Streaming)
admin.site.register(AttendanceSlot)
admin.site.register(Attendance)
36 changes: 36 additions & 0 deletions congress/migrations/0002_attendance_attendanceslot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by Django 2.2.1 on 2021-03-05 20:43

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('tickets', '0014_attendant_student_id'),
('editions', '0012_auto_20200225_2152'),
('congress', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='AttendanceSlot',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('start_date', models.DateTimeField(blank=True, null=True)),
('end_date', models.DateTimeField(blank=True, null=True)),
('session', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='editions.Session')),
],
),
migrations.CreateModel(
name='Attendance',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('attendant', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='tickets.Attendant')),
('slot', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='congress.AttendanceSlot')),
],
options={
'unique_together': {('attendant', 'slot')},
},
),
]
20 changes: 20 additions & 0 deletions congress/migrations/0003_attendance_created_at.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.2.1 on 2021-03-06 12:37

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('congress', '0002_attendance_attendanceslot'),
]

operations = [
migrations.AddField(
model_name='attendance',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
]
25 changes: 23 additions & 2 deletions congress/models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
from django.db import models

# Create your models here.
from editions.models import Edition

from editions.models import Edition, Session
from tickets.models import Attendant

class Streaming(models.Model):
edition = models.ForeignKey(Edition, on_delete=models.CASCADE)
title = models.CharField(max_length=50)
url = models.URLField()


'''
For each session, 3 qrs will be created. This QR must be read by the students
if the want to demostrate that they attended the session. Mininum of QRs: 2
'''


class AttendanceSlot(models.Model):
session = models.ForeignKey(Session, on_delete=models.CASCADE)
start_date = models.DateTimeField(blank=True, null=True)
end_date = models.DateTimeField(blank=True, null=True)


class Attendance(models.Model):
attendant = models.ForeignKey(Attendant, on_delete=models.CASCADE, blank=True)
slot = models.ForeignKey(AttendanceSlot, on_delete=models.CASCADE, blank=True)
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
unique_together = ["attendant", "slot"]
1 change: 0 additions & 1 deletion congress/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from congress.models import Streaming


class StreamingSerializer(ModelSerializer):


Expand Down
Loading