Django Rest Framework API by accept multiple input and output multiple data
<p>I am two months with Django and API Rest Framework.
I am developing an API to accept (userid and week_number), and output with (week_number and status).</p>

<p>This is my model:</p>

<pre><code>class Timesheet(models.Model):
    userid = models.ForeignKey(User)
    week_number = models.CharField(max_length=2)
    status = models.CharField(max_length=255)
</code></pre>

<p>This is my complete data example:</p>

<pre><code> [
    {
        "id": 1,
        "userid": 1,
        "week_number": "32",
        "status": "completed"
    },
    {
        "id": 2,
        "userid": 1,
        "week_number": "33",
        "status": "approved"
    },
    {
        "id": 3,
        "userid": 1,
        "week_number": "34",
        "status": "incomplete"
    }
]
</code></pre>

<p>API I want is like this:</p>

<pre><code>ACCEPT: userid=1
ACCEPT: week_number=33
ACCEPT: week_number=34
OUTPUT: week_number=33,status="approved"
OUTPUT: week_number=34,status="incomplete"
</code></pre>

<p>Note: I do not want data about <code>week_number=32</code></p>

<p>I not sure how to code for this kind of API. Hope someone can help.</p>