Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't get json attribute from Set #315
I have a model like this:
class Pool(db.Entity): pool_name = Required(str, unique=True) builds = Set(lambda: Build) class Build(db.Entity): data = Required(Json) pools = Set(lambda: Pool)
but when I do something like:
def distinct(iter): d = defaultdict(int) for item in iter: > d[item] = d[item] + 1 E TypeError: unhashable type: 'TrackedDict'
Tested on master branch(orm)
We cannot return a set of json's, because json value is subclass of dict and cannot be item of set. Probably for such attributes we can indeed return a list of dicts. I think the result elements should be not a TrackedDict instances, but just plain dicts, and their subsequent modifications should not be reflected in models.