-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Remove explicit django CMS dependency #36
Conversation
Reviewer's Guide by SourceryThis PR removes the explicit dependency on django CMS, making the package more flexible by allowing it to be used independently. The implementation wraps django CMS-specific code in conditional imports and adds checks to ensure proper configuration when django CMS is not present. The changes primarily focus on restructuring the code to handle both django CMS and non-django CMS scenarios. Class diagram for AbstractText with conditional CMSPluginclassDiagram
class AbstractText {
+OneToOneField cmsplugin_ptr
+TextField body
+JSONField json
+CharField rte
+search_fields
+__str__()
+__init__(*args, **kwargs)
+clean()
+save(*args, **kwargs)
+clean_plugins()
+copy_referenced_plugins()
+get_referenced_plugins()
+add_existing_child_plugins_to_pairs(plugins_pairs)
+_get_inline_plugin_ids()
+post_copy(old_instance, ziplist)
+notify_on_autoadd_children(request, conf, children)
}
class CMSPlugin {
}
AbstractText --> CMSPlugin : "if apps.is_installed('cms')"
Class diagram for TextConfig with new check_no_cms_configclassDiagram
class TextConfig {
+ready()
}
class AppConfig {
}
TextConfig --> AppConfig
TextConfig : +check_no_cms_config()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
We have skipped reviewing this pull request. We don't review packaging changes - Let us know if you'd like us to change this.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
+ Coverage 80.21% 80.43% +0.21%
==========================================
Files 17 17
Lines 940 930 -10
Branches 106 104 -2
==========================================
- Hits 754 748 -6
+ Misses 143 138 -5
- Partials 43 44 +1 ☔ View full report in Codecov by Sentry. |
Hi, Does this means this package would be usable without djangocms ? |
This is what I would like to put up for discussion. It would only offer an |
That would be very interesting so we could introduce its usage in non-cms apps that live in a CMS project to have the same editor everywhere, however i imagine it could be difficult to manage with the cms specific features.
The HTMLField is nice but from experience i think the widget would be important also. |
@sveetch That's already possible today: You can use |
This is a great idea. Let's do it. |
@sourcery-ai review |
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.
Hey @fsbraun - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- The MIGRATION_MODULES setting should be a dictionary, not a list (link)
Overall Comments:
- There appears to be an import error - get_url_endpoint() was moved to widgets.py but utils.py still shows up as an import source in some files. This needs to be fixed to prevent runtime errors.
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@sourcery-ai review |
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.
Hey @fsbraun - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@sourcery-ai review |
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.
Hey @fsbraun - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding documentation about the features and limitations when using the package without django CMS
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Remove the explicit dependency on django CMS by conditionally importing CMS-related modules and functionalities only if 'cms' is installed. This change allows the package to be used independently of django CMS, enhancing its flexibility and usability in different environments. Update the package version to 0.4.0 to reflect these changes.
Enhancements:
Chores: