Created
June 24, 2020 11:39
-
-
Save AtufaShireen/de8302f290d30bc68ab1923fe72b6c33 to your computer and use it in GitHub Desktop.
users/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import User | |
class Profile(models.Model): | |
user=models.OneToOneField(User,on_delete=models.CASCADE) | |
bio=models.TextField() | |
pic=models.ImageField(default='default.jpg',upload_to='profile_pics') | |
def __str__(self): | |
return f'{self.user.username}\'s Profile ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment