﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24377	UUIDField as primary key breaks inline admins	Michael Angeletti	Tim Graham	"{{{
class Parent(models.Model):
    uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    name = models.CharField(max_length=255)

class Child(models.Model):
    uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    name = models.CharField(max_length=255)
    parent = models.ForeignKey(Parent)
}}}

{{{
class ChildInline(admin.TabularInline):
    model = Child

class ParentAdmin(admin.ModelAdmin):
    inlines = [ChildInline]
}}}

== Given the above models and admins: ==

If you attempt to create a {{{Parent}}}, all the {{{Child}}} fields will contain {{{This field is required.}}} errors.

I think the issue here is {{{default=uuid.uuid4}}}, and I think what's happening is, since the {{{uuid4}}} value provided to the {{{uuid}}} field on page load will differ from the {{{uuid4}}} value provided when the form is posted, Django is considering the state as having been changed (resulting in validation).

I've set the Component as Forms, since this is most likely a form issue, rather than being admin-specific. I've also set the Severity to Release Blocker, since the last {{{UUIDField}}} issue I encountered was marked as such, and since this sort of breaks the (probably) most common usage of {{{UUIDField}}}. Please let me know if I should not set the Severity in the future."	Bug	closed	Forms	dev	Release blocker	fixed			Accepted	1	0	0	0	0	0
