Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
norbert_mate
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
norbert_mate
12y ago
Hi languagehacker, this is not science fiction. It just shows you a way of implementing a serializer that works for all kind of models in Django Rest Framework.
2.
▲
by
norbert_mate
12y ago
Thanks.
3.
▲
by
norbert_mate
12y ago
"The best documentation is the source code" :-) . I use to read it but sometimes is really hard to understand what's going on. As you said the serializer does a lot of thing.
4.
▲
by
norbert_mate
12y ago
Correct. It's very easy to create a simple model serializer and this is what the general model serializer does. It's no big deal just saves a few line of code.
5.
▲
by
norbert_mate
12y ago
I agree with you. It is a bit weird that a serializer can interact with the database but what it basically does: hides the database interaction.
6.
▲
by
norbert_mate
12y ago
In Django Rest Framework (DRF) you need serializer class. Maybe this is because DRF is not tightly coupled with the models from Django framework. As far as I know DRF does not support PUT/UPDATE operations for nested serializers. But t
7.
▲
Django Rest Framework general model serializer
(blog.hipwerk.com)
64 points
by
norbert_mate
12y ago
|
25 comments