Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Event and Project Models #53

Merged
merged 2 commits into from
Feb 24, 2022
Merged
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
23 changes: 23 additions & 0 deletions courses/migrations/0020_auto_20220224_2057.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.5 on 2022-02-24 15:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('courses', '0019_auto_20220222_2142'),
]

operations = [
migrations.AlterField(
model_name='article',
name='home_page_display',
field=models.CharField(blank=True, choices=[('Featured', 'Featured'), ('Exclusive', 'Exclusive')], max_length=20, null=True),
),
migrations.AlterField(
model_name='article',
name='status',
field=models.CharField(choices=[('Published', 'Published'), ('Draft', 'Draft'), ('Created', 'Created'), ('Rejected', 'Rejected')], default='Draft', max_length=20),
),
]
23 changes: 23 additions & 0 deletions courses/migrations/0021_auto_20220224_2105.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.5 on 2022-02-24 15:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('courses', '0020_auto_20220224_2057'),
]

operations = [
migrations.AlterField(
model_name='article',
name='home_page_display',
field=models.CharField(blank=True, choices=[('Exclusive', 'Exclusive'), ('Featured', 'Featured')], max_length=20, null=True),
),
migrations.AlterField(
model_name='article',
name='status',
field=models.CharField(choices=[('Rejected', 'Rejected'), ('Draft', 'Draft'), ('Created', 'Created'), ('Published', 'Published')], default='Draft', max_length=20),
),
]
25 changes: 25 additions & 0 deletions events/migrations/0003_auto_20220224_2057.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.5 on 2022-02-24 15:27

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


class Migration(migrations.Migration):

dependencies = [
('members', '0006_auto_20220222_2142'),
('events', '0002_event_domain_of_event'),
]

operations = [
migrations.AddField(
model_name='event',
name='event_lead',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='members.member'),
),
migrations.AddField(
model_name='event',
name='organisers',
field=models.ManyToManyField(blank=True, related_name='Organising_Members', to='members.Member'),
),
]
5 changes: 3 additions & 2 deletions events/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import models
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify

from members.models import Member
# Create your models here.

GENDER_CHOICES = [
Expand Down Expand Up @@ -29,7 +29,8 @@ class Event(models.Model):
registration_start_date = models.DateField(null=True, blank=True)
registration_end_date = models.DateField(null=True, blank=True)
domain_of_event=models.ManyToManyField('courses.Domain',related_name='Domain_of_Events',blank=True)

event_lead=models.ForeignKey(Member,on_delete=models.SET_NULL, null=True,blank=True)
organisers=models.ManyToManyField(Member,related_name='Organising_Members',blank=True)
def __str__(self):
return self.name

Expand Down
34 changes: 34 additions & 0 deletions projects/migrations/0009_auto_20220224_2057.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 3.2.5 on 2022-02-24 15:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('members', '0006_auto_20220222_2142'),
('projects', '0008_project_domain_of_project'),
]

operations = [
migrations.AddField(
model_name='project',
name='contributor',
field=models.ManyToManyField(blank=True, related_name='Project_contributors', to='members.Member'),
),
migrations.AddField(
model_name='project',
name='documents_of_project',
field=models.ManyToManyField(blank=True, related_name='Project_related_docs', to='projects.Document'),
),
migrations.AddField(
model_name='project',
name='is_Team',
field=models.BooleanField(blank=True, default=True),
),
migrations.AddField(
model_name='project',
name='project_status',
field=models.CharField(choices=[('Ongoing', 'Ongoing'), ('Completed', 'Completed'), ('Stopped', 'Stopped')], default='Ongoing', max_length=20, null=True),
),
]
24 changes: 24 additions & 0 deletions projects/migrations/0010_auto_20220224_2105.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.2.5 on 2022-02-24 15:35

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


class Migration(migrations.Migration):

dependencies = [
('courses', '0021_auto_20220224_2105'),
('projects', '0009_auto_20220224_2057'),
]

operations = [
migrations.RemoveField(
model_name='project',
name='domain_of_project',
),
migrations.AddField(
model_name='project',
name='domain_of_project',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Domain_of_Projects', to='courses.domain'),
),
]
11 changes: 10 additions & 1 deletion projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import datetime
from django.contrib.auth.models import User
# Create your models here.
PROJECT_STATUS=[
('Ongoing','Ongoing'),
('Completed','Completed'),
('Stopped','Stopped')
]

class Project(models.Model):
name = models.CharField(max_length=100)
Expand All @@ -20,13 +25,17 @@ class Project(models.Model):
start_date = models.DateField(default=timezone.now)
end_date = models.DateField(null=True, blank=True)
members = models.ManyToManyField(Member)
domain_of_project=models.ManyToManyField('courses.Domain',related_name='Domain_of_Projects',blank=True)
domain_of_project=models.ForeignKey('courses.Domain',on_delete=models.CASCADE,related_name='Domain_of_Projects',null=True,blank=True)
documents_of_project=models.ManyToManyField('Document',related_name='Project_related_docs',blank=True)
tech_stack = ListCharField(
base_field=models.CharField(max_length=40),
size=20,
null=True,
max_length=(21 * 50) # 6 * 10 character nominals, plus commas
)
is_Team = models.BooleanField(default=True, blank=True)
contributor=models.ManyToManyField(Member,related_name='Project_contributors',blank=True)
project_status=models.CharField(choices=PROJECT_STATUS,max_length=20,null=True,default='Ongoing')

def __str__(self):
return self.name
Expand Down