You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
482 B
19 lines
482 B
from django.db import models
|
|
from django.contrib.auth.models import User
|
|
|
|
|
|
# Create your models here.
|
|
class Novinka(models.Model):
|
|
titulek = models.CharField(max_length=100)
|
|
zprava = models.TextField()
|
|
datum = models.DateTimeField()
|
|
autor = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
|
|
def __str__(self):
|
|
return self.titulek
|
|
|
|
class Meta:
|
|
ordering = ["-datum", ]
|
|
verbose_name = "Novinka"
|
|
verbose_name_plural = "Novinky"
|
|
|
|
|