-
Notifications
You must be signed in to change notification settings - Fork 0
added Bucket Model #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
base: release
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing some implementations on buckets
Missing code coverage on bucket
polystorage/bucket/bucket.py needs to become polystorage/models.py (can also become polystorage/models/bucket.py and being imported into polystorage/models/__init__.py)
polystorage package needs to become a django app
Coverage needs to be set up as a django code coverage system
polystorage/main.py needs to disappear
test_settings should be created
Code coverage should import all files in polystorage folder
| super().save(*args, **kwargs) # Save first to get the ID | ||
|
|
||
| if is_new: | ||
| self.create_associated_bucket_instance() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the super().save() after this line to avoid desynchronized databases
polystorage/models/bucket.py
Outdated
| } | ||
|
|
||
| self.root_path = generated_root_path | ||
| self.save(update_fields=['root_path']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove self.save() for the same reasons
polystorage/models/bucket.py
Outdated
| random_folder = uuid.uuid4().hex[:8] | ||
| # Use the INSTANCES_MAIN_FOLDER setting as the base directory | ||
| base_folder = settings.INSTANCES_MAIN_FOLDER | ||
| # Construct the full root path | ||
| generated_root_path = os.path.join(base_folder, random_folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root path should be generated on the cluster, and returned in the json response
No description provided.