Skip to content

Instantly share code, notes, and snippets.

@dmitrii-kalashnikov
Created January 9, 2019 22:30
Show Gist options
  • Save dmitrii-kalashnikov/ee536a1a70b57b7f3c0c703a45daf440 to your computer and use it in GitHub Desktop.
Save dmitrii-kalashnikov/ee536a1a70b57b7f3c0c703a45daf440 to your computer and use it in GitHub Desktop.
Model
class Post(models.Model): # Books
user = models.ForeignKey(User, on_delete=models.CASCADE)
image = VersatileImageField(
'Image',
upload_to='media_my/',null=True,
blank=True
)
title = models.CharField(max_length=150, db_index=True)
slug = models.SlugField(max_length=150, unique=True, blank=True)
tags = models.ManyToManyField('Tag', blank=True, related_name='posts')
body1 = models.TextField(blank=True)
body2 = models.TextField(blank=True)
body3 = models.TextField(blank=True)
body4 = models.TextField(blank=True)
body5 = models.TextField(blank=True)
body6 = models.TextField(blank=True)
body7 = models.TextField(blank=True)
body8 = models.TextField(blank=True)
body9 = models.TextField(blank=True)
body10 = models.TextField(blank=True)
date_pub= models.DateTimeField(auto_now_add=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment