Rename VirtualModel user field to avoid conflict#38
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.
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.
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.
fjsj
left a comment
There was a problem hiding this comment.
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
userattribute fromVirtualModelto_userto avoid conflict with ForeignKey and OneToOneField fields with the same nameSummary by Sourcery
Rename the internal
userattribute in VirtualModel to_userto prevent naming conflicts with Django field names, bump the package version to 0.3.1, and update the changelog accordingly.Bug Fixes:
userattribute to_userin VirtualModel to avoid conflicts with ForeignKey and OneToOneField names.Documentation:
Chores: