initial commit
This commit is contained in:
0
student/__init__.py
Normal file
0
student/__init__.py
Normal file
BIN
student/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
student/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
student/__pycache__/admin.cpython-310.pyc
Normal file
BIN
student/__pycache__/admin.cpython-310.pyc
Normal file
Binary file not shown.
BIN
student/__pycache__/apps.cpython-310.pyc
Normal file
BIN
student/__pycache__/apps.cpython-310.pyc
Normal file
Binary file not shown.
BIN
student/__pycache__/models.cpython-310.pyc
Normal file
BIN
student/__pycache__/models.cpython-310.pyc
Normal file
Binary file not shown.
5
student/admin.py
Normal file
5
student/admin.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.contrib import admin
|
||||
from .models import Student
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(Student)
|
||||
6
student/apps.py
Normal file
6
student/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class StudentConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'student'
|
||||
26
student/migrations/0001_initial.py
Normal file
26
student/migrations/0001_initial.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-09 21:50
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Student',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('w_number', models.IntegerField()),
|
||||
('classes', models.CharField(max_length=200)),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
0
student/migrations/__init__.py
Normal file
0
student/migrations/__init__.py
Normal file
BIN
student/migrations/__pycache__/0001_initial.cpython-310.pyc
Normal file
BIN
student/migrations/__pycache__/0001_initial.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
student/migrations/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
student/migrations/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
11
student/models.py
Normal file
11
student/models.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
# Create your models here.
|
||||
class Student(models.Model):
|
||||
w_number = models.IntegerField()
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||
classes = models.CharField(max_length = 200)
|
||||
|
||||
def __str__(self):
|
||||
return self.user.username.capitalize()
|
||||
3
student/tests.py
Normal file
3
student/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
student/views.py
Normal file
3
student/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user