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: What replaced is_ajax() is django 4

2022-03-07 Thread Jet Ezra
Cool, all I have realised is that if someone is specifically doing a jquery powered application, they can just write it and use it on their own using the below code ```py def is_ajax(): return request.headers.get('x-requested-with') == 'XMLHttpRequest' ``` And that's it! It will start

Re: Error : Circula import

2022-03-03 Thread Jet Ezra
But the link tells you the details and how to solve the problem. Anyway, I think you forgot to share the said screenshots. I can't find them. Also, when you are asking please, don't try to direct us how we should solve this problem. Just detail your problem and wait for your answer. Simple. A

What replaced is_ajax() is django 4

2022-02-23 Thread Jet Ezra
Hello team. Am sending jquery requests in django 4 but I have just realised that checking if the requests were from jquery using is_ajax and then perform ajax related actions is not possible. What is replacing this, and why would such a cool feature be removed. Thanks -- You received this

Re: static files not getting served

2021-12-05 Thread Jet Ezra
To me, you are not going to serve static files but media files, am sure that the image linked above was as a result of uploading it somewhere, However much you try, heroku does not handle media files, when you upload your image, the next refresh of the running dyno will delete it from your file

Re: Get data from table rows and save in database

2021-12-04 Thread Jet Ezra
STEPS 1. You will add a name attribute to all your input fields. 2. Add the crsf_token django template in-built filter to support 'POST' 3. Change your form's method to 'POST' 4. Add an action attribute and set it to your view 5. Then the JQUERY part will be as follows 6. Don't forget to give your

Re: Where to deploy django application

2021-11-29 Thread Jet Ezra
Digital ocean even becomes easier, I love both anyways On Mon, Nov 29, 2021 at 11:50 AM Eugene TUYIZERE wrote: > Dear Team, > > This is just for advice. > > I would like to know any other hosting provider that uses GitHub to update > the app like we do on Heroku. > > Thank you > > -- > *Eugene*

Idea

2021-09-18 Thread Jet Ezra
I know this may not be necessary at the moment because we are comfortable depending on front-end frameworks, but I have my two ideas here: 1. what if django alone without any framework can be used to design progressive web apps, with routers that do not reload the page, we currently have one of