making uniqueconstraint error easier to read
This commit is contained in:
parent
f1a47aaed4
commit
1fe0d7bbdf
|
@ -52,8 +52,8 @@ class RecordTable(table.Table):
|
|||
|
||||
def _check_unique(self, document) -> bool:
|
||||
matches = [
|
||||
match
|
||||
for match in self.search(
|
||||
dict(match)
|
||||
for match in super().search(
|
||||
reduce(
|
||||
ior,
|
||||
[
|
||||
|
|
|
@ -140,7 +140,7 @@ class Pointer(Field):
|
|||
def reference(cls, value: Record | str):
|
||||
# XXX This could be smarter
|
||||
if isinstance(value, str):
|
||||
if '::' not in value:
|
||||
if "::" not in value:
|
||||
raise PointerReferenceError("Value {value} does not look like a reference!")
|
||||
return value
|
||||
if value:
|
||||
|
@ -203,5 +203,3 @@ class Collection(Field):
|
|||
for backref in target._metadata.backrefs(type(record)):
|
||||
target[backref.name] = record
|
||||
db.save(target)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user