Skip to content
Advertisement

Tag: django-views

Update a field of a Django Object

I’m trying to update an object field in django. Usually I would do something like this: The problem is that the field to modify (in the example above: “name”) is not known and passed as an argument to the post request. So I would have something like this: now this triggers the error: What is the correct way to update

Django Querysets adding additional information inside View

I’m currently working on a small django application for my school. I got two models involved in this problem: “category” and “device”, which are connected in a one-to-many relationship category—<device(s) I added one page/template/view for the category overview, containing a large table with all the relevant information on every category created. Querying the categories like this: And displaying them inside

Advertisement