drf-writable-nested
Writable nested model serializer for Django REST Framework (by beda-software)
drf-extra-fields
Extra Fields for Django Rest Framework (by Hipo)
drf-writable-nested | drf-extra-fields | |
---|---|---|
11 | 1 | |
1,051 | 649 | |
0.5% | 0.9% | |
3.5 | 6.2 | |
5 months ago | 9 months ago | |
Python | Python | |
GNU General Public License v3.0 or later | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
drf-writable-nested
Posts with mentions or reviews of drf-writable-nested.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-09-08.
-
10 things you need to know to effectively use Django Rest Framework
use the quite popular, third party library DRF Writable Nested do it on your own I would recommend choosing the second option at least once, so you will know what’s going underneath.
-
Django rest writable nested serialization
We have used this successfully for years. https://github.com/beda-software/drf-writable-nested I have never understood why this is not a default and used by more devs. Hope that helps
-
Using non-generic API Views
Yeah OK, I'll just change and comment where appropriate (albeit I did not really test this code nor did use a proper text editor): class UserListCreateView(generics.ListCreateAPIView): permission_classes = [permissions.IsAuthenticated] serializer_class = AccountSerializer There is a built-in permission for authentication. But if that does not suit you, you can implement your own. (e.g. IsTeacher, IsSchool etc.) Also, it seems like you are returning teachers as a nested data, so you might need to implement your own logic for the serializer to be writable, or use drf-writable-nested ``` def get_queryset(self, request): if self.request.user.account_type == "teacher": return Account.objects.all().filter(username=self.request.user)
-
Pros and Cons of Django REST Framework
Combo of drf-writeable-nested and my own tools.
- Elegant way to serialize models with M2M fields with DRF
-
How do you serialize a user profile model along with the User model together?
You could also make use of https://github.com/beda-software/drf-writable-nested which I recently found. It makes dealing with nested fields and relations super easy.
- Why use DRF when I can use JsonResponse using native Django?
-
Django Rest Framework Tips and Tricks
If we want to create or update a nested model relation. drf-writable-nested is a package that comes for rescue; it supports nested serializer both create and update operations. it also available supports for OneToOne, ForeignKey, ManyToMany. https://github.com/beda-software/drf-writable-nested
-
Help! how do you use create () method at serializer if you have tow or more nested serializers?
drf-writable-nested does that for you.
-
This field must be unique error in postman in OnetoOneField in Django Rest Framework
Also, I suggest you look at the writable nested serializers package as it will simplify your code a lot.
drf-extra-fields
Posts with mentions or reviews of drf-extra-fields.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-06-27.
-
Django Rest Framework Tips and Tricks
drf-extra-fields has many more custom fields, like Base64ImageField, it will accept a image file as base64 encoded and will return as image file. please checkout the https://github.com/Hipo/drf-extra-fields for more information
What are some alternatives?
When comparing drf-writable-nested and drf-extra-fields you can also consider the following projects:
graphene-django - Build powerful, efficient, and flexible GraphQL APIs with seamless Django integration.
django-rest-auth - This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
strawberry - A GraphQL library for Python that leverages type annotations 🍓
drf-yasg - Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.