Skip to content
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

Open
wants to merge 82 commits into
base: main
Choose a base branch
from

Conversation

auvipy
Copy link

@auvipy auvipy commented Mar 18, 2017

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.

@auvipy auvipy changed the title ORM Fields API & Related improvement to fix historic design limitations and inconsistancies ORM Fields API & Related improvement to fix design limitations and inconsistancies Mar 18, 2017
@auvipy auvipy changed the title ORM Fields API & Related improvement to fix design limitations and inconsistancies ORM improvements using VirtualField and relation API clean up Mar 22, 2017
@auvipy auvipy changed the title ORM improvements using VirtualField and relation API clean up ORM improvements using VirtualField, ReverseRelation and relation API clean up Mar 31, 2017
Copy link
Author

@auvipy auvipy left a 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.
Copy link
Author

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
Copy link
Author

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:
==============================================================
Copy link
Author

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:
Copy link
Author

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:
Copy link
Author

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:
----------------
Copy link
Author

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:
==========================================

Copy link
Author

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."

Copy link
Author

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
~~~~~~~~~~~~~~~~~~~

Copy link
Author

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``
==========================================

Copy link
Author

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

@auvipy auvipy changed the title ORM improvements using VirtualField, ReverseRelation and relation API clean up Refactor ORM by private relation API clean up and using ReverseRelations and VirtualFields Mar 31, 2017

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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refctors -> refactors ?

Copy link
Author

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

Base automatically changed from master to main February 25, 2021 16:04
@ShaheedHaque
Copy link

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).

@auvipy
Copy link
Author

auvipy commented Dec 23, 2021

i think django-polymorphic should be improved by the changes if done correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants