Created
January 9, 2019 22:30
-
-
Save dmitrii-kalashnikov/ee536a1a70b57b7f3c0c703a45daf440 to your computer and use it in GitHub Desktop.
Model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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