-# so after that, an 'authority' record will e.g. have a 'reg-pis' field with the hrns of its pi-users
-augment_map = {'authority': {'reg-pis' : 'reg_pis',},
- 'slice': {'reg-researchers' : 'reg_researchers',},
- 'user': {'reg-pi-authorities' : 'reg_authorities_as_pi',
- 'reg-slices' : 'reg_slices_as_researcher',},
- }
-
-
+# so after that, an 'authority' record will e.g. have a 'reg-pis' field
+# with the hrns of its pi-users
+augment_map = {'authority': {'reg-pis': 'reg_pis', },
+ 'slice': {'reg-researchers': 'reg_researchers', },
+ 'user': {'reg-pi-authorities': 'reg_authorities_as_pi',
+ 'reg-slices': 'reg_slices_as_researcher', },
+ }
+
+
+# xxx mystery
+# the way we use sqlalchemy might be a little wrong
+# in any case what has been observed is that (Reg)Records as returned by an sqlalchemy
+# query not always have their __dict__ properly adjusted
+# typically a RegAuthority object would have its object.name set properly, but
+# object.__dict__ has no 'name' key
+# which is an issue because we rely on __dict__ for many things, in particular this
+# is what gets exposed to the drivers (this is historical and dates back before sqlalchemy)
+# so it is recommended to always run this function that will make sure
+# that such built-in fields are properly set in __dict__ too
+#