-
Notifications
You must be signed in to change notification settings - Fork 1
WIP: Adds basic CRUD for categories #13
base: akshay
Are you sure you want to change the base?
Conversation
I'm unable to confirm if categories are viewable/updatable -- I tried hitting the following endpoint: Is this expected? |
Just basic reads and some validation on the fields.
class Meta: | ||
model = Item | ||
fields = ["id", "name", "details"] | ||
fields = ["id", "name", "details", "category"] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
No description provided.