-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
68 changed files
with
1,194 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.contrib import admin | ||
from .models import Institution, Document, Student | ||
# Register your models here. | ||
admin.site.register(Institution) | ||
admin.site.register(Student) | ||
admin.site.register(Document) |
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 FileAppConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'file_app' |
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,24 @@ | ||
from django import forms | ||
from django.contrib.auth.models import User | ||
from .models import Institution, Student | ||
|
||
class UserForm(forms.ModelForm): | ||
password = forms.CharField(widget=forms.PasswordInput()) | ||
|
||
class Meta(): | ||
model = User | ||
fields = ('username','password') | ||
|
||
class InstitutionForm(forms.ModelForm): | ||
class Meta(): | ||
model = Institution | ||
fields = ('wallet_id',) | ||
|
||
class StudentForm(forms.ModelForm): | ||
class Meta(): | ||
model = Student | ||
fields = ('student_first_name','student_last_name') | ||
|
||
class FileForm(forms.Form): | ||
document_name = forms.CharField(label="Document name ",max_length=200) | ||
student_id = forms.IntegerField(label="Student id ") |
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 3.2.5 on 2022-03-24 00:31 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Document', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('institution_id', models.IntegerField()), | ||
('name', models.CharField(max_length=1000)), | ||
('wallet_id', models.CharField(max_length=1000)), | ||
], | ||
), | ||
] |
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,55 @@ | ||
# Generated by Django 3.2.5 on 2022-03-24 00:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('file_app', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Institution', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('institution_id', models.IntegerField(blank=True, null=True)), | ||
('name', models.CharField(blank=True, max_length=1000, null=True)), | ||
('wallet_id', models.CharField(blank=True, max_length=1000, null=True)), | ||
], | ||
), | ||
migrations.RemoveField( | ||
model_name='document', | ||
name='name', | ||
), | ||
migrations.RemoveField( | ||
model_name='document', | ||
name='wallet_id', | ||
), | ||
migrations.AddField( | ||
model_name='document', | ||
name='document_hash_value', | ||
field=models.CharField(blank=True, max_length=1000, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='document', | ||
name='document_link', | ||
field=models.CharField(blank=True, max_length=1000, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='document', | ||
name='document_name', | ||
field=models.CharField(blank=True, max_length=1000, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='document', | ||
name='student_id', | ||
field=models.IntegerField(blank=True, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='document', | ||
name='institution_id', | ||
field=models.IntegerField(blank=True, null=True), | ||
), | ||
] |
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,25 @@ | ||
# Generated by Django 3.2.5 on 2022-03-24 01:30 | ||
|
||
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.AUTH_USER_MODEL), | ||
('file_app', '0002_auto_20220324_0137'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='institution', | ||
name='name', | ||
), | ||
migrations.AddField( | ||
model_name='institution', | ||
name='user', | ||
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 3.2.5 on 2022-03-24 04:40 | ||
|
||
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.AUTH_USER_MODEL), | ||
('file_app', '0003_auto_20220324_0230'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Student', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('student_id', models.IntegerField(blank=True, null=True)), | ||
('student_first_name', models.CharField(blank=True, max_length=100, null=True)), | ||
('student_last_name', models.CharField(blank=True, max_length=100, null=True)), | ||
('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.9 on 2022-03-24 09:18 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('file_app', '0004_student'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='document', | ||
name='student_id', | ||
), | ||
migrations.AddField( | ||
model_name='document', | ||
name='student', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='file_app.student'), | ||
), | ||
] |
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 3.2.9 on 2022-03-24 13:32 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('file_app', '0005_auto_20220324_1018'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='document', | ||
name='institution_id', | ||
), | ||
migrations.AddField( | ||
model_name='document', | ||
name='institution', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='file_app.institution'), | ||
), | ||
] |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1.14 KB
file_app/migrations/__pycache__/0002_auto_20220324_0137.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+1.14 KB
file_app/migrations/__pycache__/0002_auto_20220324_0137.cpython-39.pyc
Binary file not shown.
Binary file added
BIN
+871 Bytes
file_app/migrations/__pycache__/0003_auto_20220324_0230.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+871 Bytes
file_app/migrations/__pycache__/0003_auto_20220324_0230.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+780 Bytes
file_app/migrations/__pycache__/0005_auto_20220324_1018.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+780 Bytes
file_app/migrations/__pycache__/0005_auto_20220324_1018.cpython-39.pyc
Binary file not shown.
Binary file added
BIN
+803 Bytes
file_app/migrations/__pycache__/0006_auto_20220324_1432.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+803 Bytes
file_app/migrations/__pycache__/0006_auto_20220324_1432.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,33 @@ | ||
from django.db import models | ||
from django.contrib.auth.models import User | ||
# Create your models here. | ||
class Institution(models.Model): | ||
|
||
user = models.OneToOneField(User,on_delete=models.CASCADE,blank=True,null=True) | ||
|
||
institution_id = models.IntegerField(blank=True, null=True) | ||
wallet_id =models.CharField(blank=True, null=True, max_length=1000) | ||
|
||
def __str__(self): | ||
return self.user.username | ||
|
||
|
||
class Student(models.Model): | ||
|
||
user = models.OneToOneField(User,on_delete=models.CASCADE,blank=True,null=True) | ||
|
||
student_id = models.IntegerField(blank=True, null=True) | ||
student_first_name = models.CharField(max_length=100,blank=True,null=True) | ||
student_last_name = models.CharField(max_length=100,blank=True,null=True) | ||
def __str__(self): | ||
return str(self.student_first_name)+" "+str(self.student_last_name) | ||
|
||
|
||
class Document(models.Model): | ||
institution = models.ForeignKey(Institution, blank=True, null=True, on_delete=models.CASCADE) | ||
document_name = models.CharField(blank=True, null=True, max_length=1000) | ||
document_link = models.CharField(blank=True, null=True, max_length=1000) | ||
document_hash_value = models.CharField(blank=True, null=True, max_length=1000) | ||
student = models.ForeignKey(Student,on_delete=models.CASCADE,blank=True,null=True) | ||
def __str__(self): | ||
return self.document_name |
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,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
Oops, something went wrong.