suggestion for improving entity and relation creation
Use Case
I create and try to use a schema which defines a relation called created_by
or creator
between two entities.
Current behavior
Despite both examples being defined in CubicWeb's base schema, CubicWeb lets me go ahead and instead gives me cryptic error messages when I try to manipulate entities in the given case.
File "/usr/lib/python3/dist-packages/cubicweb/web/views/basecomponents.py", line 210, in render_body
self.entity.view('metadata', w=w)
File "/usr/lib/python3/dist-packages/cubicweb/entity.py", line 594, in view
return view.render(row=self.cw_row, col=self.cw_col, w=w, **kwargs)
File "/usr/lib/python3/dist-packages/cubicweb/view.py", line 175, in render
view_func(**context)
File "/usr/lib/python3/dist-packages/cubicweb/web/views/baseviews.py", line 454, in cell_call
self.w(u'<span class="value">%s</span>' % entity.creator.name())
AttributeError: 'tuple' object has no attribute 'name'
Expected behaviour
CubicWeb's basic entities and relations are part of an reserved vocabulary and I get a warning when I try to overwrite them (maybe even have to pass some flag to do so).
Note
Not in any way important or urgent, I just ran twice into this problem today, and I think its a common problem.