initial commit

This commit is contained in:
Lucas
2024-06-09 14:55:25 -07:00
commit 3fd16b4833
39 changed files with 276 additions and 0 deletions

0
student/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

5
student/admin.py Normal file
View 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
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class StudentConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'student'

View 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)),
],
),
]

View File

11
student/models.py Normal file
View 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
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
student/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.