@@ -436,7 +436,7 @@ Version 0.3.0 introduced 3 custom signals sent by the resolver:
436436
437437The interesting signal is `resolver_update `, as it allows you to introspect,
438438which computed fields on which records were updated. But since that signal is sent right away from deep within
439- of the resolver's tree update, it comes with a few caveats:
439+ the resolver's tree update, it comes with a few caveats:
440440
441441- still in resolver DFS recursion
442442- database not fully resynced yet
@@ -445,7 +445,7 @@ of the resolver's tree update, it comes with a few caveats:
445445
446446.. WARNING ::
447447
448- To not compromise the resolver's DFS update, you should not use any complicated or likely-to-raise code
448+ To not compromise the resolver's tree update, you should not use any complicated or likely-to-fail code
449449 in your `resolver_update ` handler. Also database interactions, especially calls to `update_dependent `,
450450 should be avoided.
451451
@@ -456,19 +456,19 @@ After that you can safely do your processing, example:
456456
457457 from computedfields.signals import resolver_update, resolver_exit
458458
459- def collect_updates (sender , model , fields , pks ):
459+ def collect_updates (sender , model , fields , pks , ** kwargs ):
460460 # filter for updates of ModelXY.comp
461461 if model == ModelXY and ' comp' in fields:
462- # only collect updated pks here
462+ # only collect stuff here
463463 store_somewhere(pks)
464464 resolver_update.connect(collect_updates)
465465
466- def on_resolver_exit (sender ):
466+ def on_resolver_exit (sender , ** kwargs ):
467467 # retrieve updated pks for ModelXY.comp
468468 pks = retrieve_again()
469469 # here it is safe to do all nasty things
470470 # without compromising the resolver update
471- likely_to_fail(ModelXY.objects.filter(pk__pks ))
471+ likely_to_fail(ModelXY.objects.filter(pk__in = pks ))
472472 resolver_exit.connect(on_resolver_exit)
473473
474474
0 commit comments