-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/pip/corpus/pillow-10.2.0
- Loading branch information
Showing
27 changed files
with
2,504 additions
and
8 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
corpus/accounts/migrations/0004_alter_executivemember_date_joined.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,23 @@ | ||
# Generated by Django 4.2.4 on 2024-01-24 13:40 | ||
import datetime | ||
|
||
from django.db import migrations | ||
from django.db import models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("accounts", "0003_alter_executivemember_date_joined"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="executivemember", | ||
name="date_joined", | ||
field=models.DateTimeField( | ||
default=datetime.datetime(2024, 1, 24, 19, 10, 0, 912845), | ||
verbose_name="Date Joined", | ||
), | ||
), | ||
] |
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,5 +1,5 @@ | ||
asgiref==3.7.2 | ||
Django==4.2.7 | ||
Django==4.2.10 | ||
gunicorn==21.2.0 | ||
packaging==23.1 | ||
Pillow==10.2.0 | ||
|
Empty file.
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,12 @@ | ||
from django.contrib import admin | ||
from robotrix.models import Announcement | ||
from robotrix.models import Invite | ||
from robotrix.models import RobotrixUser | ||
from robotrix.models import Team | ||
|
||
# Register your models here. | ||
|
||
admin.site.register(RobotrixUser) | ||
admin.site.register(Team) | ||
admin.site.register(Announcement) | ||
admin.site.register(Invite) |
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,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class RobotrixConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "robotrix" |
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,69 @@ | ||
from django import forms | ||
from robotrix.models import Announcement | ||
from robotrix.models import Invite | ||
from robotrix.models import RobotrixUser | ||
from robotrix.models import Team | ||
|
||
from corpus.forms import CorpusModelForm | ||
|
||
|
||
class RobotrixForm(CorpusModelForm): | ||
class Meta: | ||
model = RobotrixUser | ||
fields = [ | ||
"from_nitk", | ||
"college_name", | ||
"roll_no", | ||
"ieee_member", | ||
"ieee_membership_no", | ||
"phone_no", | ||
] | ||
|
||
def clean(self): | ||
data = self.cleaned_data | ||
if data.get("from_nitk", None) and not data.get("roll_no", None): | ||
raise forms.ValidationError( | ||
"Enter your roll number for verification that you are from NITK" | ||
) | ||
|
||
if data.get("ieee_member", None) and not data.get("ieee_membership_no", None): | ||
raise forms.ValidationError( | ||
"Enter your IEEE Membership Number for verification " | ||
+ "that you are an IEEE member" | ||
) | ||
|
||
return data | ||
|
||
|
||
class TeamCreationForm(CorpusModelForm): | ||
class Meta: | ||
model = Team | ||
fields = ["team_name"] | ||
|
||
|
||
class AnnouncementForm(CorpusModelForm): | ||
ANNOUNCEMENT_OPTIONS = [ | ||
("1", "No email to be sent."), | ||
("2", "Send email to all team leaders."), | ||
("3", "Send email to all members"), | ||
] | ||
|
||
announcement_mailing = forms.ChoiceField( | ||
widget=forms.Select, choices=ANNOUNCEMENT_OPTIONS | ||
) | ||
|
||
class Meta: | ||
model = Announcement | ||
fields = [ | ||
"content", | ||
"url_link", | ||
"url_link_text", | ||
"announcement_type", | ||
"announcement_mailing", | ||
] | ||
|
||
|
||
class InviteForm(CorpusModelForm): | ||
class Meta: | ||
model = Invite | ||
fields = ["invite_email"] |
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,160 @@ | ||
# Generated by Django 4.2.4 on 2024-02-18 14:33 | ||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations | ||
from django.db import models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Announcement", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("content", models.TextField()), | ||
("url_link", models.URLField(blank=True, null=True)), | ||
( | ||
"url_link_text", | ||
models.CharField(blank=True, max_length=200, null=True), | ||
), | ||
( | ||
"announcement_type", | ||
models.CharField( | ||
choices=[ | ||
("A", "All Robotrix Users"), | ||
("P", "Paid Teams"), | ||
("U", "Unpaid Teams"), | ||
("N", "Registered for Robotrix but no team"), | ||
("NI", "Not Registered for Robotrix"), | ||
], | ||
default="A", | ||
max_length=2, | ||
), | ||
), | ||
("date_created", models.DateTimeField(auto_now_add=True)), | ||
("date_modified", models.DateTimeField(auto_now=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="RobotrixUser", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("from_nitk", models.BooleanField(default=True)), | ||
( | ||
"college_name", | ||
models.CharField( | ||
default="National Institute of Technology Karnataka", | ||
max_length=200, | ||
), | ||
), | ||
("roll_no", models.CharField(blank=True, max_length=8, null=True)), | ||
("ieee_member", models.BooleanField(default=False)), | ||
("ieee_membership_no", models.BigIntegerField(blank=True, null=True)), | ||
( | ||
"phone_no", | ||
models.CharField( | ||
max_length=15, unique=True, verbose_name="Phone Number" | ||
), | ||
), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="Team", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("team_name", models.CharField(max_length=200)), | ||
( | ||
"payment_status", | ||
models.CharField( | ||
choices=[ | ||
("E", "Exempt"), | ||
("U", "Fee Not Paid"), | ||
("P", "Fee Paid"), | ||
], | ||
default="U", | ||
max_length=1, | ||
), | ||
), | ||
( | ||
"team_leader", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="leader", | ||
to="robotrix.robotrixuser", | ||
), | ||
), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="robotrixuser", | ||
name="team", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="team", | ||
to="robotrix.team", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="robotrixuser", | ||
name="user", | ||
field=models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="Invite", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("invite_email", models.EmailField(max_length=254)), | ||
( | ||
"inviting_team", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="invite_to_team", | ||
to="robotrix.team", | ||
), | ||
), | ||
], | ||
), | ||
] |
Empty file.
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,72 @@ | ||
from accounts.models import User | ||
from django.db import models | ||
from embedathon.models import PAYMENT_STATUS | ||
|
||
|
||
class RobotrixUser(models.Model): | ||
user = models.OneToOneField(User, on_delete=models.CASCADE) | ||
from_nitk = models.BooleanField(default=True) | ||
college_name = models.CharField( | ||
max_length=200, default="National Institute of Technology Karnataka" | ||
) | ||
roll_no = models.CharField(max_length=8, blank=True, null=True) | ||
ieee_member = models.BooleanField(default=False) | ||
ieee_membership_no = models.BigIntegerField(blank=True, null=True) | ||
phone_no = models.CharField( | ||
max_length=15, | ||
unique=True, | ||
verbose_name="Phone Number", | ||
) | ||
team = models.ForeignKey( | ||
"Team", on_delete=models.CASCADE, related_name="team", blank=True, null=True | ||
) | ||
|
||
def __str__(self): | ||
return self.user.email | ||
|
||
|
||
class Team(models.Model): | ||
team_name = models.CharField(max_length=200, blank=False, null=False) | ||
team_leader = models.ForeignKey( | ||
RobotrixUser, on_delete=models.CASCADE, related_name="leader" | ||
) | ||
|
||
payment_status = models.CharField( | ||
max_length=1, choices=PAYMENT_STATUS, blank=False, null=False, default="U" | ||
) | ||
|
||
def __str__(self): | ||
return self.team_name | ||
|
||
|
||
class Announcement(models.Model): | ||
|
||
AnnouncementType = ( | ||
("A", "All Robotrix Users"), | ||
("P", "Paid Teams"), | ||
("U", "Unpaid Teams"), | ||
("N", "Registered for Robotrix but no team"), | ||
("NI", "Not Registered for Robotrix"), | ||
) | ||
|
||
content = models.TextField(blank=False, null=False) | ||
url_link = models.URLField(blank=True, null=True) | ||
url_link_text = models.CharField(max_length=200, blank=True, null=True) | ||
announcement_type = models.CharField( | ||
max_length=2, choices=AnnouncementType, blank=False, null=False, default="A" | ||
) | ||
date_created = models.DateTimeField(auto_now_add=True) | ||
date_modified = models.DateTimeField(auto_now=True) | ||
|
||
def __str__(self): | ||
return self.content[:20] + "..." | ||
|
||
|
||
class Invite(models.Model): | ||
inviting_team = models.ForeignKey( | ||
Team, on_delete=models.CASCADE, related_name="invite_to_team" | ||
) | ||
invite_email = models.EmailField(blank=False, null=False) | ||
|
||
def __str__(self): | ||
return self.invite_email |
Oops, something went wrong.