#24317: Deprecate field.rel, replace it with real field instances
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by auvipy):
Replying to [comment:6 akaariai]:
> Every time I start working on any larger refactor I end up breaking
Django's own code so badly I have to restart my work.
>
> So, in short, the only sensible way forward is to do minor changes to
the related fields API over time, and use deprecations where possible.
>
> The main goals are:
> - Clean up the main API, that is the API defined by ForeignObject
> - Make the "Rel" instances respect the same API
> - Finally make "Rel" instances to be full Field instances (including
registration to models)
>
> The first step is to investigate all the "related_fields,
foreign_related_fields, ..." attributes. It might suffice we have just one
attribute: data_fields. To get what related_fields currently is, use
zip(self.data_fields, self.remote_field.data_fields). The rest of the
attributes can be constructed from the zipped version, self.data_fields or
self.remote_field.data_fields.
>
> Any takers for this clean-up? If not, then I'll tackle it myself when
time permits.
have you started working on it? if not, then to help you to start clean up
the API what is you suggestion to start work from? I have some familiarity
with django internal code bases.
--
Ticket URL: <https://code.djangoproject.com/ticket/24317#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.6e4f4e56d2fe3f9e64c8a4e5486315a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.