Skip to content
Advertisement

Tag: django

How to sum with condition in a Django queryset

I am trying to sum Django query with a condition. Suppose I have got some data like this: And these types are string and they have values, like x = 1, y = 25, z = -3 How can I sum up all the values without a loop? Currently using a loop. Answer To perform the calculation inside the database

Saving related model objects in single view

I am beginner and I am working on Django project – risk assessment application. I have a trouble to achieve saving on related objects for my application risk record. I am using MultiModelForm to achieve the following. I am successfully creating Whatif instance and connecting it with GuideWordi instance on save, however, I am not able to connect my RiskRecordi

No module named ‘fusioncharts’

I am trying to plot fusion chart in django after adding fusioncharts,I am getting an error. Answer Normally when you get such an error it is because you forgot to install the module, did a bit of research and came to the conclusion that you can install using pip: open the command prompt use the command pip install twFusionCharts.If this

Advertisement