Skip to content

Updating an object with a unique field raises a validation exception. #37

Open
@aanastasiou

Description

@aanastasiou

With Redisco 0.1.4

class Foo(models.Model):
Field1 = models.Attribute(indexed = True)
Field2 = models.Attribute(unique = True)

Foo(Field1="1", Field2 = "blah").save(); Foo(Field1="Alpha", Field2 = "Beta").save()

Q = Foo.objects.all()[0]
Q.update_attributes(Field1 = "Whatever")
Q.save()

This returns a failed validation message that Field2 is not unique.

If i am not missing something here, this is a simple update, not even touching the field that is declared as unique and after that operation the "unique" condition would still hold.

BTW, in the above example, if the field is not declared as unique then everything works as expected...but then i really want the field to be declared as unique :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions