mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #20228 - Documented unique_for_date and exclude behavior.
Thanks Deepak Thukral for the patch.
This commit is contained in:
@@ -207,7 +207,17 @@ class Post(models.Model):
|
||||
posted = models.DateField()
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
return self.title
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class DateTimePost(models.Model):
|
||||
title = models.CharField(max_length=50, unique_for_date='posted', blank=True)
|
||||
slug = models.CharField(max_length=50, unique_for_year='posted', blank=True)
|
||||
subtitle = models.CharField(max_length=50, unique_for_month='posted', blank=True)
|
||||
posted = models.DateTimeField(editable=False)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
class DerivedPost(Post):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user