from django db import models from django contrib auth models import Us

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from django.db import models
from django.contrib.auth.models import User
class New(models.Model):
title = models.CharField(max_length=25)
content = models.TextField()
author = models.ForeignKey(User)
date = models.DateTimeField()
active = models.BooleanField(default=False)
def __unicode__(self):
return self.title