Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

WIP: Adds basic CRUD for categories #13

Open
wants to merge 2 commits into
base: akshay
Choose a base branch
from
Open

WIP: Adds basic CRUD for categories #13

wants to merge 2 commits into from

Conversation

oyeb
Copy link
Contributor

@oyeb oyeb commented Mar 27, 2020

No description provided.

@oyeb oyeb self-assigned this Mar 27, 2020
@oyeb oyeb added the enhancement New feature or request label Mar 27, 2020
@oyeb
Copy link
Contributor Author

oyeb commented Mar 27, 2020

I'm unable to confirm if categories are viewable/updatable -- I tried hitting the following endpoint:
/api/v1/categories/<pk>/
But the app claims that no route matches.

Is this expected?

@oyeb oyeb added the help wanted Extra attention is needed label Mar 27, 2020
@oyeb oyeb removed the help wanted Extra attention is needed label Mar 28, 2020
@oyeb oyeb changed the base branch from master to akshay March 28, 2020 10:25
class Meta:
model = Item
fields = ["id", "name", "details"]
fields = ["id", "name", "details", "category"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me and @akshaytgithub were of the opinion that cateegory field isn't probably required now

Copy link
Contributor Author

@oyeb oyeb Mar 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not serialized in a nested manner, just the category ID turns up:
/api/v1/items/

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 3,
            "name": "n95",
            "details": "life saver!",
            "category": 1
        }
    ]
}

Is that too much?

@@ -16,8 +26,11 @@ class Meta:
class Requirement(models.Model):
created = models.DateTimeField(auto_now_add=True)
user = models.OneToOneField(User, on_delete=models.CASCADE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the Requirement should be linked to the hospital_profile rather than the user, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This an upstream thing: pls report in #14.
I'm doing only as much work as is required to link items and categories.

@oyeb oyeb changed the title Adds basic CRUD for categories WIP: Adds basic CRUD for categories Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants