The models are
class Article(models.Model):
title = models.CharField(max_length=30)
class Categories(models.Model):
article = models.ForeignKey(Article)
name = models.CharField(max_length=30)
There is a possibility of using drf-extensions, how it can be used.
How to do setup to have URLs like
/api/article/92285/categories
It should be able to serve responses for GET, POST, and PUT
from following format
{
"article_id": 92285,
"views": 0,
"downloads": 0,
"shares": 0,
"handle_url": "",
"title": "Test dataset",
"defined_type": "dataset",
"status": "Drafts",
"published_date": "",
"description": "Test description",
"total_size": 0,
"owner": {
"id": 13483,
"full_name": "John Carter"
},
"authors": [
{
"first_name": "John ",
"last_name": "Carter",
"id": 13483,
"full_name": "John Carter"
}
],
"tags": [
],
"categories": [
{
"id": 135,
"name": "Technology"
},
]
"files": [
]
}
--