Re: [Django] #11398: pre_syncdb signal to signal before creating tables for models

17 views
Skip to first unread message

Django

unread,
Jan 19, 2012, 1:20:29 PM1/19/12
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version:
Severity: Normal | 1.1-beta-1
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Design
Needs tests: 0 | decision needed
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by luizvital):

* cc: luiz.vital@… (added)
* ui_ux: => 0
* easy: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 19, 2012, 2:39:35 PM1/19/12
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version:
Severity: Normal | 1.1-beta-1
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Design
Needs tests: 0 | decision needed
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by luizvital):

* cc: luiz.vital@… (removed)


Comment:

I have a simple use case for this:

I'm using GeoDjango and I need to INSERT custom projections to the
`spatial_ref_sys` postgis table before any geometry field is created,
because they will use the custom SRID.

This signal would be handy, specially when creating test databases.

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:9>

Django

unread,
Jan 19, 2012, 2:39:51 PM1/19/12
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version:
Severity: Normal | 1.1-beta-1
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Design
Needs tests: 0 | decision needed
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by luizvital):

* cc: luiz.vital@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:10>

Django

unread,
Jun 13, 2012, 10:49:36 AM6/13/12
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version:
Severity: Normal | 1.1-beta-1
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Design
Needs tests: 0 | decision needed
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by v.z.afzal@…):

Will this be integrated into the next Major release?

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:11>

Django

unread,
Jun 14, 2012, 11:15:17 AM6/14/12
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version:
Severity: Normal | 1.1-beta-1
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Design
Needs tests: 0 | decision needed
Easy pickings: 0 | Needs documentation: 0
| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by v.z.afzal@…):

Note: If you want to apply this patch on Windows, you may need to resave
the patch file in MS-DOS compatible mode.

- Open with wordpad
- Select File->Save As
- Give it a name and select the format as: Text Document - MS-DOS format

It should work after making this change

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:12>

Django

unread,
Jun 14, 2012, 11:15:32 AM6/14/12
to django-...@googlegroups.com

Comment (by v.z.afzal@…):

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:13>

Django

unread,
Mar 23, 2013, 3:51:56 AM3/23/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version: 1.1-beta
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* stage: Design decision needed => Accepted


Comment:

While I'm violently against signals in general, this one doesn't look too
dangerous.

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:15>

Django

unread,
Apr 30, 2013, 2:03:58 PM4/30/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version: 1.1-beta
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by stvsmth):

I see that this has a patch, tests and documentation and that it was
recently accepted.

It does seem to have an old version attribute (1.1.beta).

Is there anything I can do to assist with this ticket? We us a similar
custom patch and I would like to get out of the business of patching
Django.

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:16>

Django

unread,
May 7, 2013, 12:19:28 PM5/7/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version:
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by stvsmth):

* cc: stvsmth (added)
* version: 1.1-beta =>


--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:17>

Django

unread,
May 18, 2013, 1:16:36 PM5/18/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version:
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by dstufft):

* cc: donald@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:18>

Django

unread,
May 18, 2013, 1:27:22 PM5/18/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version:
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by akaariai):

I think we don't want to send pre_syncdb from flush. I know post_syncdb is
sent from flush, but that seems wrong, and it makes post_syncdb harder
than necessary to use for schema changes. I am not even sure what one
could do in pre_syncdb signal sent from flush. Creating data doesn't work,
it is going to be flushed anyway, doing schema changes in pre_syncdb seems
wrong, too. Maybe creating data for unmanaged models, but then those
aren't ever flushed...

Could we at least add a kwarg "flush=True/False" to the signal, even if it
is a bit silly to get a post_syncdb signal from flush?

I would prefer to add post_flush signal and stop sending post_syncdb from
flush, but doing that is a direct break of the backwards compatibility
rules... Ideas how to do that in backwards-compat way?

Otherwise the patch looks sane (patch not reviewed, just skimmed...). I am
referring to: https://github.com/dstufft/django/compare/pre-syncdb-signal

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:19>

Django

unread,
May 18, 2013, 3:18:58 PM5/18/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version:
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by dstufft):

It's sent there to be consistent with post_syncdb.

I would however be agreeable to not doing pre_syncdb there. As far as
post_syncdb goes that's another issue that you should probably open up a
ticket for so a new signal can be added and flush triggering post_syncdb
can be deprecated.

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:20>

Django

unread,
May 19, 2013, 8:49:03 AM5/19/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version:
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by akaariai):

I think it is a good idea to not send pre_syncdb from flush. I just don't
see any use for that.

In addition, in separate ticket lets add a "flush" argument to post_syncdb
so that one can distinguish between flush and syncdb in the signal. This
is somewhat ugly, but I don't feel like tackling the backwards
compatibility problems. Anyways, this is another ticket's problem.

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:21>

Django

unread,
May 23, 2013, 1:58:19 AM5/23/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: closed
Component: Core (Management | Version:
commands) | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Donald Stufft <donald@…>):

In [changeset:"8133ee6cb4c3e9fee613ee772197dc77cdc78cd1"]:
{{{
#!CommitTicketReference repository=""
revision="8133ee6cb4c3e9fee613ee772197dc77cdc78cd1"
Merge pull request #1200 from dstufft/pre-syncdb-signal

Fixed #11398 - Added a pre_syncdb signal
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:23>

Django

unread,
May 23, 2013, 1:58:18 AM5/23/13
to django-...@googlegroups.com
#11398: pre_syncdb signal to signal before creating tables for models
-------------------------------------+-------------------------------------
Reporter: yrashk@… | Owner: nobody
Type: New feature | Status: closed
Component: Core (Management | Version:
commands) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Donald Stufft <donald@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"3de1288042f2dc1cb8a2b36ae0fc4d9e0beb6494"]:
{{{
#!CommitTicketReference repository=""
revision="3de1288042f2dc1cb8a2b36ae0fc4d9e0beb6494"


Fixed #11398 - Added a pre_syncdb signal
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/11398#comment:22>

Reply all
Reply to author
Forward
0 new messages