Django Review Documentation

My questions:

How can I fill in the Description field? in the options table on my docs page, here is an example of my function and a screenshot of how it looks

def delete(self, request, id_):
    repository = self.get_object(id_, owner=request.user)
    repository.delete()
    return Response(status=status.HTTP_204_NO_CONTENT, headers={"web_words": request.user.profile.web_words, "repo_words": request.user.profile.repo_words, "files": request.user.profile.files})

enter image description here

+4
source share
1 answer

The DRF documentation is not detailed in this question (or I skipped the part where it is), but it mentions the rest_framework.schemas.SchemaGeneratorclass and it seems that this class really does all the introspective things. Fortunately, the source code is well structured and easy to read.

get_path_fields ( , : get_schemaget_linksget_link), , help_text.

, :

class MyResource(models.Model):
    slug = models.CharField(unique=True, help_text=_("unique alphanumeric identifier"))
    ...

+2

Source: https://habr.com/ru/post/1694291/


All Articles