Serializers#

class djangoapp_sample.serializers.blog.BlogSerializer(*args, **kwargs)[source]#

Complete representation for detail and writing usage.

get_view_url(obj)[source]#

Return the HTML detail view URL.

If request has been given to serializer this will be an absolute URL, else a relative URL.

get_article_count(obj)[source]#

Return count of related articles.

class djangoapp_sample.serializers.blog.BlogResumeSerializer(*args, **kwargs)[source]#

Simpler Blog representation for nested list. It won’t be suitable for writing usage.

class djangoapp_sample.serializers.article.ArticleSerializer(*args, **kwargs)[source]#

Complete representation for detail and writing usage.

Blog relation have two serializer fields, one for read only to return resumed details and another one for write only with complete detail and which expect a blog ID.

get_view_url(obj)[source]#

Return the HTML detail view URL.

If request has been given to serializer this will be an absolute URL, else a relative URL.

class djangoapp_sample.serializers.article.ArticleResumeSerializer(*args, **kwargs)[source]#

Simpler Article representation for nested list. It won’t be suitable for writing usage.