Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- from django.contrib.auth.models import User
- # Create your models here.
- class UserProfile(models.Model):
- user = models.OneToOneField(User)
- def __unicode__(self):
- return self.user.username
- class Post(models.Model):
- header = models.CharField(max_length = 30)
- text = models.CharField(max_length = 170)
- author = models.ForeignKey(UserProfile)
- def __str__(self):
- return self.post
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement