Show substances in a nicer way

This commit is contained in:
2024-05-18 03:13:31 +01:00
parent 4baffbe014
commit 0bb64fd144
4 changed files with 194 additions and 29 deletions

View File

@@ -65,14 +65,9 @@ class DrugDetail(LoginRequiredMixin, StaffMemberRequiredMixin, ObjectRead):
detail_url_args = ["type", "pk"]
def get_object(self, **kwargs):
print("GET")
pk = kwargs.get("pk")
info = Drug.objects.get(pk=pk)
# self.extra_context = {}
print("info", info)
# return dictionary
return info.__dict__
return info
class DrugClear(LoginRequiredMixin, StaffMemberRequiredMixin, APIView):