-
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.
- Loading branch information
1 parent
cb7090f
commit f9f738a
Showing
5 changed files
with
72 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Generated by Django 3.2.8 on 2022-05-24 06:46 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.KERNEL_FACULTYMEMBER_MODEL), | ||
('faculty_biodata', '0021_auto_20210502_0253'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ProfessionalBackground', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('datetime_created', models.DateTimeField(auto_now_add=True)), | ||
('datetime_modified', models.DateTimeField(auto_now=True)), | ||
('start_date', models.DateField()), | ||
('end_date', models.DateField(blank=True, null=True)), | ||
('is_full_date', models.BooleanField(default=False)), | ||
('position', models.CharField(max_length=127)), | ||
('organisation', models.CharField(max_length=127)), | ||
('description', models.TextField(blank=True)), | ||
('priority', models.IntegerField(default=0)), | ||
('visibility', models.BooleanField(default=True)), | ||
('faculty_member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.KERNEL_FACULTYMEMBER_MODEL)), | ||
], | ||
options={ | ||
'swappable': 'FACULTY_BIODATA_PROFESSIONALBACKGROUND_MODEL', | ||
}, | ||
), | ||
] |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import swapper | ||
from django.db import models | ||
|
||
from common_biodata.models import AbstractPosition | ||
from faculty_biodata.models.abstract_classes.base_model import BaseModel | ||
|
||
|
||
class ProfessionalBackground(AbstractPosition, BaseModel): | ||
""" | ||
This model contains information about professional background of a | ||
faculty member | ||
""" | ||
|
||
class Meta: | ||
""" | ||
Meta class for ProfessionalBackground | ||
""" | ||
|
||
swappable = swapper.swappable_setting('faculty_biodata','ProfessionalBackground') | ||
|
||
def __str__(self): | ||
""" | ||
Return the string representation of the model | ||
:return: the string representation of the model | ||
""" | ||
|
||
faculty_member = self.faculty_member | ||
string = super().__str__() | ||
return f'{faculty_member}: {string}' |