Skip to content
Snippets Groups Projects
Commit 32103ef6 authored by Swen Vermeul's avatar Swen Vermeul
Browse files

return attributes after hitting TAB, depending on object status (is_new)

parent 9db47d8e
No related branches found
No related tags found
No related merge requests found
from .property import PropertyHolder
from .attribute import AttrHolder
from .utils import VERBOSE
from .definitions import get_definition_for_entity
class OpenBisObject():
......@@ -36,6 +37,14 @@ class OpenBisObject():
for key in kwargs:
setattr(self, key, kwargs[key])
def __dir__(self):
defs = get_definition_for_entity(self.entity)
if self.is_new:
return defs['attrs_new']
else:
return defs['attrs']
def _set_data(self, data):
# assign the attribute data to self.a by calling it
# (invoking the AttrHolder.__call__ function)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment