You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Site(StructuredNode):
pass
class Node(StructuredNode):
site = RelationshipTo('Site', 'site', cardinality=One)
site = Site()
node = Node()
node.site.connect(site)
site2 = Site()
node.site.connect(site2) # fails
node.site.replace(site2) # fails
# The only pattern that I could find that works is
existing_site = node.site.get_or_none()
if existing_site:
node.site.reconnect(existing_site, site)
else:
node.site.connect(site)
Suggestion: make replace() work so that we don't have to query the existing_site
The text was updated successfully, but these errors were encountered:
Example code:
Suggestion: make
replace()
work so that we don't have to query theexisting_site
The text was updated successfully, but these errors were encountered: