Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion labelbox/orm/db_object.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from datetime import datetime, timezone
from functools import wraps
import logging
import json

from labelbox import utils
from labelbox.exceptions import InvalidQueryError, InvalidAttributeError
Expand Down Expand Up @@ -92,7 +93,7 @@ def __str__(self):
attribute_values = {
field.name: getattr(self, field.name) for field in self.fields()
}
return "<%s %s>" % (self.type_name().split(".")[-1], attribute_values)
return "<%s %s>" % (self.type_name().split(".")[-1], json.dumps(attribute_values, indent=4, default=str))

def __eq__(self, other):
return (isinstance(other, DbObject) and
Expand Down
4 changes: 2 additions & 2 deletions labelbox/orm/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def _attributes_of_type(cls, attr_type):

@classmethod
def fields(cls):
""" Returns a generateor that yields all the Fields declared in a
""" Returns a generator that yields all the Fields declared in a
concrete subclass.
"""
for attr in cls._attributes_of_type(Field):
Expand All @@ -398,7 +398,7 @@ def fields(cls):

@classmethod
def relationships(cls):
""" Returns a generateor that yields all the Relationships declared in
""" Returns a generator that yields all the Relationships declared in
a concrete subclass.
"""
return cls._attributes_of_type(Relationship)
Expand Down