Worked out API's
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from classes.models import Classes
|
||||
|
||||
# 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)
|
||||
classes = models.ManyToManyField(Classes)
|
||||
|
||||
def __str__(self):
|
||||
return self.user.username.capitalize()
|
||||
Reference in New Issue
Block a user