-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parent objects to mongodb documents #9
Comments
[pages] consider making children elements draggable in the UI |
[bug] position field broken with children elements def create(self, data, parent_id=None):
data['created_at'] = datetime.datetime.now()
data['last_edited'] = datetime.datetime.now()
data['position'] = self.collection.count_documents({}) + 1 # Assign the next position
if parent_id is not None:
data['parent_id'] = parent_id # Add the parent_id to the document
return self.collection.insert_one(data).inserted_id We need to change this such that, if parent is not null, we use different logic to determine position. |
If we want to create child documents of parent documents...
This should be as simple as adding a
parent
key:valueThe text was updated successfully, but these errors were encountered: