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

added Cnic field in teacher model #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ django-debug-toolbar
django-filter
django-flat-responsive
django-flat-theme
django
django==4.2.1
pillow
pytz
sqlparse
19 changes: 19 additions & 0 deletions students/migrations/0002_alter_studentfee_valid_until.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.1 on 2023-05-13 10:31

import datetime
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('students', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='studentfee',
name='valid_until',
field=models.DateField(default=datetime.date(2023, 6, 1), verbose_name='Valid Until'),
),
]
3 changes: 2 additions & 1 deletion teachers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
# from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.db.models import Sum
from django.db.models.functions import Trunc

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by Django 4.2.1 on 2023-05-13 10:31

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


class Migration(migrations.Migration):

dependencies = [
('teachers', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='teacher',
name='cnic',
field=models.CharField(default='added fields', max_length=13),
preserve_default=False,
),
migrations.CreateModel(
name='TeacherSalary',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('valid_until', models.DateField(default=datetime.date(2023, 6, 1), verbose_name='Valid Until')),
('total_amount', models.PositiveIntegerField(default=0)),
('paid_on', models.DateTimeField(auto_now_add=True)),
('teacher', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='teachers.teacher')),
],
),
migrations.CreateModel(
name='FinanceSummary',
fields=[
],
options={
'verbose_name': 'Finance Summary',
'verbose_name_plural': 'Finance Summary',
'proxy': True,
'indexes': [],
'constraints': [],
},
bases=('teachers.teachersalary',),
),
]
1 change: 1 addition & 0 deletions teachers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Teacher(models.Model):
date_of_birth = models.DateField()
social_security_number = models.CharField(max_length=30)
phone_no = models.CharField(max_length=11, default="0000000")
cnic = models.CharField(max_length=13)
address = models.CharField(max_length=150, default="Not Set")
is_teaching = models.BooleanField(default=True)
profile_image = models.ImageField(upload_to=user_directory_path, blank=True)
Expand Down