Opened 12 years ago

Closed 10 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: dev
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 by Andrei Antoukh, 12 years ago

Cc: niwi@… added

comment:2 by Łukasz Rekucki, 12 years ago

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

comment:3 by Anssi Kääriäinen, 11 years ago

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 by Aymeric Augustin, 10 years ago

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