Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22748 closed Bug (fixed)

post_migrate documentation example is wrong

Reported by: Rudolph Froger Owned by: Tim Graham
Component: Documentation Version: dev
Severity: Release blocker Keywords: app-loading
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The example in the documentation https://docs.djangoproject.com/en/dev/ref/signals/#post-migrate does not work, it's probably copied from the old post_syncdb docs. One needs to pass the AppConfig instance, so the example should read:

from django.db.models.signals import post_migrate
from django.apps import apps

def my_callback(sender, **kwargs):
    # Your specific logic here
    pass

post_migrate.connect(my_callback, sender=apps.get_app_config('yourapp'))

Attachments (1)

22748.diff (902 bytes ) - added by Tim Graham 10 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Aymeric Augustin, 10 years ago

Keywords: app-loading added
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham, 10 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned

by Tim Graham, 10 years ago

Attachment: 22748.diff added

comment:3 by Tim Graham, 10 years ago

Has patch: set

comment:4 by Simon Charette, 10 years ago

Triage Stage: AcceptedReady for checkin

LGTM

comment:5 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In a00efa30d6e5ca220b914415904fff5fa0a6f2c5:

Fixed #22748 -- Corrected post_migrate usage example.

Thanks Rudolph for the report.

comment:6 by Tim Graham <timograham@…>, 10 years ago

In 170255caf43f2d0ae072f0b7a22da90f50bd95b0:

[1.7.x] Fixed #22748 -- Corrected post_migrate usage example.

Thanks Rudolph for the report.

Backport of a00efa30d6 from master

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