#15688: unique_for_date validation doesn't run with admin readonly_fields
-------------------------------------+-------------------------------------
Reporter: jacob | Owner: nobody
Status: new | Milestone: 1.4
Component: django.contrib.admin | Version: 1.3
Keywords: admin readonly_fields | Triage Stage:
unique_for unique_for_date | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
-------------------------------------+-------------------------------------
Model:
{{{
import datetime
from django.db import models
class Entry(models.Model):
title = models.CharField(max_length=255)
slug = models.SlugField(unique_for_date='created')
created = models.DateField(default=datetime.date.today)
}}}
Admin:
{{{
from django.contrib import admin
from .models import Entry
admin.site.register(Entry, readonly_fields=['created'])
}}}
With this, I'm able to create multiple entries with the same `created`
date. If I remove `created` field from `readonly_fields`validation fires
as expected.
Also see [http://groups.google.com/group/django-
users/browse_thread/thread/2e35cc9eb522ccc7 this django-users thread]
reporting something similar with `auto_now` and `editable=False`.
--
Ticket URL: <http://code.djangoproject.com/ticket/15688>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.