Skip to content

Commit

Permalink
upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PPNG06 committed Mar 24, 2022
1 parent e9bb2ac commit 0a6ed38
Show file tree
Hide file tree
Showing 68 changed files with 1,194 additions and 0 deletions.
Binary file added db.sqlite3
Binary file not shown.
Empty file added file_app/__init__.py
Empty file.
Binary file added file_app/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added file_app/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added file_app/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added file_app/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file added file_app/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file added file_app/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file added file_app/__pycache__/forms.cpython-38.pyc
Binary file not shown.
Binary file added file_app/__pycache__/forms.cpython-39.pyc
Binary file not shown.
Binary file added file_app/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added file_app/__pycache__/models.cpython-39.pyc
Binary file not shown.
Binary file added file_app/__pycache__/views.cpython-38.pyc
Binary file not shown.
Binary file added file_app/__pycache__/views.cpython-39.pyc
Binary file not shown.
6 changes: 6 additions & 0 deletions file_app/admin.py
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)
6 changes: 6 additions & 0 deletions file_app/apps.py
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'
24 changes: 24 additions & 0 deletions file_app/forms.py
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 ")
23 changes: 23 additions & 0 deletions file_app/migrations/0001_initial.py
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)),
],
),
]
55 changes: 55 additions & 0 deletions file_app/migrations/0002_auto_20220324_0137.py
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),
),
]
25 changes: 25 additions & 0 deletions file_app/migrations/0003_auto_20220324_0230.py
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),
),
]
26 changes: 26 additions & 0 deletions file_app/migrations/0004_student.py
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)),
],
),
]
23 changes: 23 additions & 0 deletions file_app/migrations/0005_auto_20220324_1018.py
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'),
),
]
23 changes: 23 additions & 0 deletions file_app/migrations/0006_auto_20220324_1432.py
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 added file_app/migrations/__init__.py
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.
Binary file not shown.
Binary file not shown.
33 changes: 33 additions & 0 deletions file_app/models.py
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
3 changes: 3 additions & 0 deletions file_app/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
Loading

0 comments on commit 0a6ed38

Please sign in to comment.