Opened 4 years ago

Closed 2 years ago

#18672 closed New feature (fixed)

Model hooks for custom sql on syncdb and flush

Reported by: Andrei Antoukh Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: niwi@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the thread of the group "django-developers" has spoken and has proposed a much more powerful alternative to the tickets they asked to make comments to the tables and fields. (#18468 and #13867)

https://groups.google.com/forum/?fromgroups#!topic/django-developers/KhsGj1b6rnU

Also, fix the ticket #16550 because it provides a unified way to insert custom sql in the process of syncdb.

Current work: https://github.com/niwibe/django/tree/model-hooks

Change History (4)

comment:1 Changed 4 years ago by Andrei Antoukh

Cc: niwi@… added
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 4 years ago by Łukasz Rekucki

Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 4 years ago by Anssi Kääriäinen

Triage Stage: Design decision neededAccepted

I do think having a better way to install custom SQL is needed. For example if you need some views for your database the current ways of running the SQL is really lacking.

However the right solution is likely to wait for schema migrations, they could offer a much better solution than what hooks can offer. I am marking this as accepted in the meaning that a better way for installing custom SQL is needed. If the model hooks are the right way needs still more discussion.

comment:4 Changed 2 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

The new migrations framework provides a good way to do this, with its RunSQL operation.

Note: See TracTickets for help on using tickets.
Back to Top