You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
user =self.user_model.objects.filter(id=user_id).first()
70
-
if user:
71
-
return user
72
-
raise exceptions.NotFound(f'User with id: `{user_id}` not found')
77
+
user =self.get_object_or_exception(self.user_model, id=user_id)
78
+
return user
73
79
```
74
-
75
-
```python
76
-
classControllerBase:
77
-
...
78
-
```
79
-
80
-
## **Model Properties**
81
-
-### **`permission_classes`**
82
-
List of default permission classes defined in a controller `router`
83
-
84
-
-### **`auth`**
85
-
List of default Authentication instances. As described in Django-Ninja [Authentication](https://django-ninja.rest-framework.com/tutorial/authentication/). default: `[]`
86
-
87
-
-### **`api`**
88
-
Instance of NinjaExtraAPI at runtime. default:`None`
89
-
90
-
-### **`auto_import`**
91
-
states whether APIController should added to auto_controller import list. default: `True`
92
-
93
-
-### **`get_router(cls)`**
94
-
return controller to router instance if present and raises Exception is absent.
95
-
96
-
-### **`get_path_operations(cls)`**
97
-
container `dict` of route definition which are pass to Django-Ninja at runtime
Checks object permissions. This is not automated. However, when called, it triggers all `permission_classes``has_object_permission` function, just like in DRF
0 commit comments