making uniqueconstraint error easier to read

This commit is contained in:
evilchili 2025-10-03 16:38:14 -07:00
parent f1a47aaed4
commit 1fe0d7bbdf
2 changed files with 3 additions and 5 deletions

View File

@ -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,
[

View File

@ -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)