Skip to content
Advertisement

Tag: django

django.db.utils.OperationalError: no such function: JSON_VALID

I literally don’t know how to deal with it and how it is happening I am getting this error when I run python manage.py migrate, migrations were without an error. Mycode models.py views.py full command line error If you are able to solve the issue then answer and along with it also tell me any issue in my code or

Why django dependent dropdownn is not working

I cant tell where there is an error in my code. It just doesnt work as expected. My views.py My models. My forms.py I have tried but it works only after I select a year and refresh manually with the year selcted, that’s when the terms appear. I tried following the code by Vitor Freitas but couldn’t get it working.

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

How can pass primary key to url Django

I have basically 3 issues I am trying to pass the primary key of vendor in url after creating it, but when i go the vendor page it shows the error ‘ Reverse for ‘vendorCategory’ with arguments ‘(”,)’ not found. 1 pattern(s) tried: [‘vendorCategory/(?P<vendor_id>[0-9]+)/$’] ‘ In Vendor Category when i am trying to store multiple products against the specific vendor

converting a Django ValuesListQuerySet object to a float

i have time data saved (in epoch time) in a MySQL database as a IntegerField. i’m doing some data visualisation where i’d like to show orders by the hour and by day of the week as bar charts, so i’d like to convert these epoch times to date time objects and visualise the data accordingly. however, datetime.datetime.fromtimestamp() only takes in

Obtaining full requested url address

I’m looking to obtain the full requested url within python/django. I’m wondering what package might help me do this. For example, if someone goes to example.com/my-homepage, I want to capture the string ‘example.com/my-homepage’ in python. Thanks! Answer

Advertisement