Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- from django.conf import settings
- class Post(models.Model):
- title = models.CharField(max_length=50)
- date = models.DateField(auto_now_add=True)
- added_by = models.ForeignKey(settings.AUTH_USER_MODEL,
- on_delete=models.CASCADE,null=True)
- content = models.TextField()
- attachment=models.FileField(upload_to='attachment',blank='True')
- def __str__(self):
- return self.title
Add Comment
Please, Sign In to add comment