File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -9,27 +9,18 @@ class TaskProcessorRouter:
99 route_app_labels = ["task_processor" ]
1010
1111 def db_for_read (self , model : type [Model ], ** hints : None ) -> str | None :
12- """
13- If enabled, route read operations to the task processor database
14- """
1512 if model ._meta .app_label in self .route_app_labels :
1613 return "task_processor"
1714
1815 return None
1916
2017 def db_for_write (self , model : type [Model ], ** hints : None ) -> str | None :
21- """
22- If enabled, route write operations to the task processor database
23- """
2418 if model ._meta .app_label in self .route_app_labels :
2519 return "task_processor"
2620
2721 return None
2822
2923 def allow_relation (self , obj1 : Model , obj2 : Model , ** hints : None ) -> bool | None :
30- """
31- If enabled, allow relations between task processor models
32- """
3324 both_objects_from_task_processor = (
3425 obj1 ._meta .app_label in self .route_app_labels
3526 and obj2 ._meta .app_label in self .route_app_labels
@@ -47,7 +38,7 @@ def allow_migrate(
4738 ** hints : None ,
4839 ) -> bool | None :
4940 """
50- If enabled, allow migrations to hit both databases
41+ Allow migrations to hit BOTH databases
5142
5243 NOTE: We run migrations on both databases because:
5344
You can’t perform that action at this time.
0 commit comments