Order in which hooks are executed
See original GitHub issueIs it possible to control somehow the order in which hooks are executed?
My use case is something like this:
class Festival(LifecycleModelMixin, models.Model):
name = models.CharField(max_length=200)
slug = models.SlugField(unique=True, null=True, blank=True)
@hook(BEFORE_CREATE)
def set_slug(self):
self.slug = generate_slug(self.name)
@hook(BEFORE_CREATE)
def do_something_with_slug(self):
print(f"Here we want to use our slug, but it could be None: {self.slug}")
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to define Execution Order of Hooks in Cucumber - Tools QA
Order hooks to run in a particular sequence is easy to do. As we already know the way to specify hooks in cucumber-like...
Read more >Execution Order of Hooks Cucumber - ProgramsBuzz
Cucumber execute Hooks in certain order but there is a way to change the order of the execution according to the need of...
Read more >The post-Hooks guide to React call order - LogRocket Blog
Start by learning the React call order post-Hooks. ... That is to say, in what order the code is being executed in your...
Read more >Rules of Hooks - React
The answer is that React relies on the order in which Hooks are called. Our example works because the order of the Hook...
Read more >What is the order for execution of useEffect hook in react?
import React ; from "react" ; import · BrowserRouter ; Switch · Route ; from "react-router-dom" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another idea: we support a “priority” kwarg to the @hook like this:
That would do the trick, if you want I could try to implement it