from django.db import models
from django.contrib.auth.models import User
from tinymce.models import HTMLField
class Entry(models.Model):
    entry_title = models.CharField(max_length=50)
    entry_text = models.TextField()
    entry_date = models.DateTimeField(auto_now_add=True)
    entry_author = models.ForeignKey(User, on_delete=models.CASCADE)
    img = models.ImageField(upload_to='uploads/',default='uploads\coffee.jpg')
    content = HTMLField()
    class Meta:
        verbose_name_plural="entries"

    def __str__(self):
         return f'{self.entry_title}'   