daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from django.db import models
  2. from django.conf import settings
  3.  
  4. class Post(models.Model):
  5. title = models.CharField(max_length=50)
  6. date = models.DateField(auto_now_add=True)
  7. added_by = models.ForeignKey(settings.AUTH_USER_MODEL,
  8.                              on_delete=models.CASCADE,null=True)
  9. content = models.TextField()
  10. attachment=models.FileField(upload_to='attachment',blank='True')
  11.  
  12. def __str__(self):
  13.  
  14.     return self.title
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top