from django.db import models

# Create your models here.lass News(models.Model):


class News(models.Model):
    title = models.CharField(
        verbose_name="Title",
        max_length=250,
        blank=False
    )
    url = models.CharField(
        verbose_name="Url",
        max_length=500,
        blank=False)
    topic = models.CharField(
        verbose_name="Topic",
        max_length=100,
    )
    date = models.CharField(
        verbose_name="Date",
        max_length=50,
        blank=False
    )
    source = models.CharField(
        verbose_name="Source",
        max_length=100,
        blank=True
    )
    community = models.CharField(
        verbose_name="Community",
        max_length=100,
        blank=False
    )
    created_at = models.DateTimeField(auto_now_add=True, editable=False)

    class Meta:
        ordering = ("-title",)
        verbose_name = "News"
        verbose_name_plural = "News"
