11 lines
351 B
Python
11 lines
351 B
Python
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() |