Guest User

Untitled

a guest
Nov 4th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. from django.db import models
  2.  
  3.  
  4. class Classno(models.Model):
  5.     class_no = models.CharField(max_length=25)
  6.  
  7.  
  8.  
  9. class UserProfile(models.Model):
  10.     user = models.CharField(max_length=30,blank=True,null=True)
  11.     registration_no = models.CharField(max_length=20,null=True)
  12.     password = models.CharField(max_length=50)
  13.     class_no = models.ForeignKey(Classno,on_delete=models.CASCADE)
  14.  
  15.     def __str__(self):
  16.         return self.registration_no
Add Comment
Please, Sign In to add comment