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
That's it! Thanks to [ninja](https://django-ninja.dev/) & [ninja-extra](https://eadwincode.github.io/django-ninja-extra/), now you can see the auto-generated documentation inhttp://127.0.0.1:8000/api/docs.
340
+
That's it! Thanks to [ninja](https://django-ninja.dev/) & [ninja-extra](https://eadwincode.github.io/django-ninja-extra/), now you can see the auto-generated documentation athttp://127.0.0.1:8000/api/docs.
341
341
342
342
---
343
343
@@ -346,7 +346,7 @@ Easier than ever!
346
346
347
347
### File Configuration
348
348
349
-
Configure file-handling from inside your [model's file configuaration](#file-handling-example), specify a few attributes in setings.py and that's it! No extra work, no nothing. All CRUD functionalities (uploads, downloads, deletiions etc) including authentications, permissions, individual-accesses are handled automatically by `django-swiftapi`.
349
+
Configure file-handling from inside your [model's file configuration](#file-handling-example), specify a few attributes in setings.py and that's it! No extra work, no nothing. All CRUD functionalities (uploads, downloads, deletions etc) including authentications, permissions, individual-accesses are handled automatically by `django-swiftapi`.
350
350
351
351
In settings.py, just specify according to your needs. `django-swiftapi` will use these directories to write or remove files:
352
352
```
@@ -378,7 +378,7 @@ The system automatically provides these file operations:
378
378
### File Access Control
379
379
380
380
-**Public files**: Accessible without authentication
381
-
-**Private files**: Require authentication and ownership verification
381
+
-**Private files**: Require authentication and if specified, ownership verification
382
382
383
383
### Using Your Own Validation
384
384
It's super easy. Just define a function (`django-swiftapi` supports both sync & async) and put it into the dictionary variable `validator_funcs` like this:
@@ -475,6 +475,8 @@ class custom_storage_class(BaseStorage):
475
475
### Using Built-in Authentication Classes
476
476
477
477
```python
478
+
from ninja_extra import api_controller
479
+
from django_swiftapi.modelcontrol.modelcontrollers.base import SwiftBaseModelController
478
480
from django_swiftapi.modelcontrol.authenticators.django_allauth import djangoallauth_userauthentication
479
481
480
482
# Using allauth authentication
@@ -487,6 +489,8 @@ class MyController(SwiftBaseModelController):
487
489
488
490
```python
489
491
from ninja_extra import api_controller, permissions
492
+
from django_swiftapi.modelcontrol.modelcontrollers.base import SwiftBaseModelController
493
+
from django_swiftapi.modelcontrol.authenticators.django_allauth import djangoallauth_userauthentication
As simple as that! You can enable this functionality for others too or you can incorporate your own authentication classes for each operation, using:
502
+
As simple as that! You can enable this functionality for others too or you can incorporate your own customized authentication classes for each operation, using:
499
503
```python
500
504
retrieve_one_custom_permissions_list: list= []
501
505
filter_custom_permissions_list: list= []
@@ -505,9 +509,9 @@ files_remove_custom_permissions_list: list = []
505
509
delete_custom_permissions_list: list= []
506
510
```
507
511
508
-
### Enable object-level permissions
512
+
### Enabling Object-Level Permissions
509
513
510
-
If you wish to give specific object permissions like only the creator of that object can `rerieve`, `filter`, `update`, `remove` or `delete` that object, you can do so like this:
514
+
If you wish to give object-specific permissions like only the creator of that object can `rerieve`, `filter`, `update`, `remove` or `delete` that object, you can do so like this:
0 commit comments