-
Notifications
You must be signed in to change notification settings - Fork 84
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
[WIP] - Refactor ORM with VirtualField and CompositeField #39
base: main
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.
should also figure out which parts of django should also need to be taken care of for the proposed changes
|
||
Background: | ||
=========== | ||
Django's ORM is a simple & powerful tool which suits most use-cases. |
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.
might be adjusted with more streamlined detail of the back ground of the project
|
||
Abstract | ||
========== | ||
This DEP aims to improve different part of django ORM and associated |
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.
this part could be more organized
|
||
|
||
Key steps of to follow to improve ORM Field API internals: | ||
============================================================== |
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.
might add slight more elaboration about each steps
|
||
New split out Field API | ||
========================= | ||
1. BaseField: |
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.
could add some detail about how baseField might look like and what role it will play
Base structure for all Field types in django ORM wheather it is Concrete | ||
or VirtualField | ||
|
||
2. ConcreteField: |
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.
might be a ConcreteField mixing?
----------------- | ||
|
||
5. VirtualField: | ||
---------------- |
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.
add specs based on Old work and new BaseField
|
||
Proposed API and workd flow for clean ups: | ||
========================================== | ||
|
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.
some suggestions from available tickets could be sorted out and another approach could be simpler new API for relationFields/ReverseRelation/ForwardRelation/RemoteRelation etc
------------------------- | ||
"A virtual field is a model field which it correlates to one or multiple | ||
concrete fields, but doesn't add or alter columns in the database." | ||
|
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.
How migrations should be effected with virtualFields inclution in related fields?
============================= | ||
Relationship fields | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
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.
this part should be adjusted with rel clean up and newer Field API
|
||
``contenttypes`` and ``GenericForeignKey`` | ||
========================================== | ||
|
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.
This part should conform with FieldAPI, RelationFIeld, ReverseRelation, VirtualFIelds etc
… reverse relation
|
||
In order to fix these design limitations and inconsistancies, the proposed | ||
solution is to refactor Fields/RelationFields to new simpler API and | ||
incorporate virtualField type based refctors of RelationFields. |
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.
refctors -> refactors ?
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.
yes you r right. I have to adjust the dep based on master
I wonder if it is worth taking into account what something like django-polymorphic needs? (I'm not myself qualified to say what that might be). |
i think django-polymorphic should be improved by the changes if done correctly |
This is a very early WIP draft. I am still working on figuring out some issues and proper approaches.
I will share it on mailing list soon after I think it's ready for initial review. Any improvement suggestions are highly welcome.