Commit 435334b4 authored by Alexandre Fayolle's avatar Alexandre Fayolle
Browse files

Backed out changeset 7a58581d842c

This changeset breaks a number of CW tests, which depends on pre add hooks. I'm
backing it out, so that we can start the need-for-speed sprint with green tests
(and possibly rework this changeset)
parent 7a58581d842c
......@@ -266,7 +266,6 @@ class Entity(AppObject):
restrictions = set()
pending_relations = []
eschema = cls.e_schema
cache = {}
for attr, value in kwargs.items():
if attr.startswith('reverse_'):
attr = attr[len('reverse_'):]
......@@ -275,9 +274,7 @@ class Entity(AppObject):
role = 'subject'
assert eschema.has_relation(attr, role)
rschema = eschema.subjrels[attr] if role == 'subject' else eschema.objrels[attr]
cache[attr] = value # XXX what if value is processed in pre add hook (eg timeseries)?
elif isinstance(value, (tuple, list, set, frozenset)):
if not and isinstance(value, (tuple, list, set, frozenset)):
if len(value) == 1:
value = iter(value).next()
......@@ -302,7 +299,6 @@ class Entity(AppObject):
if restrictions:
rql = '%s WHERE %s' % (rql, ', '.join(restrictions))
created = execute(rql, kwargs).get_entity(0, 0)
for attr, values in pending_relations:
if attr.startswith('reverse_'):
restr = 'Y %s X' % attr[len('reverse_'):]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment