[Django] #12610: Fixture loading is interfered by signal handlers

0 views
Skip to first unread message

Django

unread,
Jan 14, 2010, 9:02:56 AM1/14/10
to djang...@holovaty.com, django-...@googlegroups.com
#12610: Fixture loading is interfered by signal handlers
-----------------------------+----------------------------------------------
Reporter: jtiai | Owner: nobody
Status: new | Milestone:
Component: django-admin.py | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 0 |
-----------------------------+----------------------------------------------
If profiles are setup as documented using unique foreignkeyand post_save
signal it's impossible to import both as a fixture since creating user
data creates (empty) profile that conflicts with fixtures to be loaded.

Specially it's inconvenient in testing. There should be option to disable
or run signals deferred while loading fixture data.

--
Ticket URL: <http://code.djangoproject.com/ticket/12610>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 14, 2010, 9:26:59 AM1/14/10
to djang...@holovaty.com, django-...@googlegroups.com
#12610: Fixture loading is interfered by signal handlers
---------------------------------------------+------------------------------
Reporter: jtiai | Owner: nobody
Status: new | Milestone:
Component: django-admin.py | Version: SVN
Resolution: | Keywords:
Stage: Design decision needed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Changes (by russellm):

* needs_better_patch: => 0
* stage: Unreviewed => Design decision needed
* needs_tests: => 0
* needs_docs: => 0

Comment:

There is already a hook to check for this - data saved during a fixture
load is loaded 'raw', and the 'raw' argument is passed to the pre/post
save handlers. If you modify your pre/post save handlers to do nothing in
the case of a raw save, you should be able to load fixtures without the
problems you describe.

There might be an argument to be made that raw saves should disable
signals completely - after all, the purpose of raw save is to prevent any
clever 'on save' logic from being executed, and excluding signals from
that process would make some sense. However, this could also be considered
a backwards incompatibility. Marking DDN until we make that decision. Feel
free to raise this on django-dev if you want to promote the idea.

--
Ticket URL: <http://code.djangoproject.com/ticket/12610#comment:1>

Django

unread,
Aug 26, 2010, 7:35:24 AM8/26/10
to djang...@holovaty.com, django-...@googlegroups.com
#12610: Fixture loading is interfered by signal handlers
---------------------------------------------+------------------------------
Reporter: jtiai | Owner: nobody
Status: new | Milestone:
Component: django-admin.py | Version: SVN
Resolution: | Keywords:
Stage: Design decision needed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Comment (by thco...@gmail.com):

I allow myself to bump this issue. I just came across this behavior. As
far I'm concerned the current way to deal with fixture loading and signal
handling by passing the 'raw' parameter is fine but it need documentation
since their is nothing on that in
http://docs.djangoproject.com/en/1.2/topics/signals/ or in
http://docs.djangoproject.com/en/1.2/ref/django-admin/#loaddata-fixture-
fixture.

If needed I would be pleased to contribute and write the required
documentation in the right place.

--
Ticket URL: <http://code.djangoproject.com/ticket/12610#comment:2>

Django

unread,
Apr 2, 2011, 1:59:07 AM4/2/11
to djang...@holovaty.com, django-...@googlegroups.com
#12610: Fixture loading is interfered by signal handlers
-------------------------------------+-------------------------------------
Reporter: jtiai | Owner: nobody
Type: New | Status: new
feature | Component: Core (Management
Milestone: | commands)
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Design | Has patch: 0
decision needed | Needs tests: 0
Needs documentation: 0 |
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Changes (by mattmcc):

* type: => New feature
* severity: => Normal


--
Ticket URL: <http://code.djangoproject.com/ticket/12610#comment:3>

Reply all
Reply to author
Forward
0 new messages