File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -256,15 +256,20 @@ Methods
256256
257257 Example::
258258
259+ from django.apps import AppConfig
259260 from django.db.models.signals import pre_save
260261
261- def ready(self):
262- # importing model classes
263- from .models import MyModel # or...
264- MyModel = self.get_model('MyModel')
265262
266- # registering signals with the model's string label
267- pre_save.connect(receiver, sender='app_label.MyModel')
263+ class RockNRollConfig(AppConfig):
264+ # ...
265+
266+ def ready(self):
267+ # importing model classes
268+ from .models import MyModel # or...
269+ MyModel = self.get_model('MyModel')
270+
271+ # registering signals with the model's string label
272+ pre_save.connect(receiver, sender='app_label.MyModel')
268273
269274 .. warning::
270275
You can’t perform that action at this time.
0 commit comments