Skip to content

Tag: django-models

Date filter binned data

I have a model in django that contains a start and end date for a financial year and a value for demand volume. I would like to filter this data on a given date range that may not coincide with the date ranges of the data, taking a proportion of the demand from each data point that may fall somewhere

django FieldError: Cannot resolve keyword ‘category_name_contains’ into field. Choices are: category, description, id, image, name, order, price

I want to build a food delivering app, but facing this error. “FieldError: Cannot resolve keyword ‘category_name_contains’ into field. Choices are: catego ry, description, id, image, name, order, price”. This is the query.py: This is the views.py This is my models.py: Here’s the …

Change boolean data when adding new registration

In this piece of code l want to change the boolean data of room when adding new registration For example: when l add new registration in django admin the boolean data of room should change to False Answer You should use Django’s signals for that. Just create signals.py in your app’s folder and do …