-
Notifications
You must be signed in to change notification settings - Fork 5
Rename VirtualModel user field to avoid conflict #38
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
Conversation
Reviewer's GuideThis PR renames the internal Updated class diagram for VirtualModelclassDiagram
class VirtualModel {
-user
+_user
+__init__(user)
+get_optimized_queryset(user)
}
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.
Pull Request Overview
This PR renames the internal "user" attribute in VirtualModel to "_user" to avoid naming conflicts with Django's ForeignKey and OneToOneField fields. The key changes are:
- Renamed the attribute in django_virtual_models/fields.py and updated its usage.
- Bumped the package version from 0.3.0 to 0.3.1 in init.py.
- Updated the CHANGELOG to reflect the renaming change.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
django_virtual_models/fields.py | Changed "user" to "_user" in attribute assignment and method call for consistency. |
django_virtual_models/init.py | Updated version number to reflect the new release version. |
CHANGELOG.md | Documented the renaming of the "user" attribute to avoid conflicts. |
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 @hugobessa - 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: 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.
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.
Thanks @hugobessa
As the API changed, I suggest a new major or minor version.
Also, please check if self.user is mentioned in docs.
Rename internal
user
attribute fromVirtualModel
to_user
to avoid conflict with ForeignKey and OneToOneField fields with the same nameSummary by Sourcery
Rename the internal
user
attribute in VirtualModel to_user
to prevent naming conflicts with Django field names, bump the package version to 0.3.1, and update the changelog accordingly.Bug Fixes:
user
attribute to_user
in VirtualModel to avoid conflicts with ForeignKey and OneToOneField names.Documentation:
Chores: