Commit 370d5ae3 authored by Behr, Svenja's avatar Behr, Svenja
Browse files

Die uuid wird nun über ein Lamba immer neu erzeugt.

parent 711da979
......@@ -29,7 +29,7 @@ class Blog(models.Model):
(6, 'Blog mit Kommentaren nur für User'),
)
identifier = models.CharField(max_length=500, unique=True, default=uuid.uuid4())
identifier = models.CharField(max_length=500, unique=True, default=lambda: uuid.uuid4())
title = models.CharField(default="Titel", max_length=200)
description = RichTextUploadingField(blank=True)
date = models.DateTimeField(default=datetime.now, blank=True)
......@@ -37,7 +37,7 @@ class Blog(models.Model):
image = models.ImageField(upload_to='images/', blank=True)
created = models.DateField(auto_now_add=True)
edited = models.DateField(auto_now=True)
status = models.IntegerField(choices=STATUS_CHOICES,default=1)
status = models.IntegerField(choices=STATUS_CHOICES, default=1)
slug = models.SlugField(max_length=300, unique=True, null=False)
def __str__(self):
......@@ -77,5 +77,3 @@ class Comment(models.Model):
def __str__(self):
return self.related_blog.identifier + ': ' + self.text
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment