Re: Calculated Fields

2022-04-11 Thread Jet Ezra
I think you can use the legendary BODMAS, and apply brackets self.total_price = self.quantity+(self.reorder_level * self.unit_price) That should work On Mon, Apr 11, 2022 at 7:49 AM tech george wrote: > Hello Mike, > > Unfortunately it's not calculating the fields as I wanted, instead it's >

Re: Calculated Fields

2022-04-11 Thread tech george
Hello Antonis, Thanks for the advice and the solution, That solved my issue. Thanks again. On Mon, Apr 11, 2022 at 9:04 AM Antonis Christofides < anto...@antonischristofides.com> wrote: > As was found out with the conversation with Mike Dewhirst, the error > appears to be because of wrong

Re: Calculated Fields

2022-04-11 Thread Antonis Christofides
As was found out with the conversation with Mike Dewhirst, the error appears to be because of wrong understanding of operator precedence . That's easy to correct with parentheses. Except for that, I wouldn't do it that

Django security releases issued: 4.0.4, 3.2.13, and 2.2.28

2022-04-11 Thread Mariusz Felisiak
Details are available on the Django project weblog: https://www.djangoproject.com/weblog/2022/apr/11/security-releases/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: Error during template rendering

2022-04-11 Thread emmanuel odor
Thanks Antonis On Sunday, April 10, 2022 at 9:54:09 AM UTC+1 Antonis Christofides wrote: > Hi! > > The error message 'relation "curriculum_standard" does not exist' has been > produced by PostgreSQL, and Django merely repeats it. In other words, > Django is telling you that while it was doing

Re: Calculated Fields

2022-04-11 Thread Ahmedrufai Otuoze
Hi Mike, I can help you solve the problems. I can clone it from your repo and we'll work on it... What do you think? On Sun, Apr 10, 2022, 11:56 PM Mike Dewhirst wrote: > > > > > -- > (Unsigned mail from my phone) > > > > Original message > From: tech george > Date: 11/4/22

sort by alphabet

2022-04-11 Thread divya murugulla
Please help me sort the queryset by name alphabetical order. plant = forms.ModelChoiceField(label='Destinations Name',queryset=GlobePlant.objects.all(),empty_label='Select the Point',required=True) Thanks & Regards, Divya -- You received this message because you are subscribed to the

Re: sort by alphabet

2022-04-11 Thread divya murugulla
latamSupplyPoints = [ (e.globe_code_id, e.globe_code.plant_name) for e in CommodityLocationXref.objects.select_related('globe_code','cmdty_loc').filter(cmdty_loc_id__in=LatamLocationIds) ] how to sort these values On Monday, April 11, 2022 at 10:00:50 PM UTC+5:30 Antonis Christofides wrote:

Debug problem

2022-04-11 Thread MRM
Hi, I am doing an django project in atom IDE. But I dont know how to debug the code line by line. So how to debug the code in atom IDE? Can you help me? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: sort by alphabet

2022-04-11 Thread Antonis Christofides
Hi, You need to replace queryset=GlobePlant.objects.all() with queryset=GlobePlant.objects.all().order_by(...) I can't tell you what arguments to give "order_by()" without seeing your GlobePlant model, but if you read Django's documentation for order_by you should be able to determine

Re: sort by alphabet

2022-04-11 Thread Antonis Christofides
Same thing, use CommodityLocatinoXref.objects.select_related(...).filter(...).order_by(...) On 11/04/2022 20.03, divya murugulla wrote: latamSupplyPoints = [ (e.globe_code_id, e.globe_code.plant_name) for e in

Re: sort by alphabet

2022-04-11 Thread divya murugulla
that is not working since my sort function is of different table On Monday, April 11, 2022 at 10:44:14 PM UTC+5:30 Antonis Christofides wrote: > Same thing, use > CommodityLocatinoXref.objects.select_related(...).filter(...).order_by(...) > > > On 11/04/2022 20.03, divya murugulla wrote: > >

Re: sort by alphabet

2022-04-11 Thread Antonis Christofides
Please read the documentation of order_by(). It tells you how you can do this. On 11/04/2022 20.15, divya murugulla wrote: that is not working since my sort function is of different table On Monday, April 11, 2022 at 10:44:14 PM UTC+5:30 Antonis Christofides wrote: Same thing, use