Re: using .annotate on a queryset and output field is a result of function

2021-06-16 Thread Nikeet NA
You cannot use properties in django orm , it does not allow that. TransactionEntry.objects.defer("users").annotate(total_price=F("num_shares")*F("price_per_share")).values('total_price') On Thursday, 17 June 2021 at 03:23:01 UTC+5:30 VISHESH MANGLA wrote: > Hello, > > I wanted to know that how

using .annotate on a queryset and output field is a result of function

2021-06-16 Thread VISHESH MANGLA
Hello, I wanted to know that how for the model below, how can I get a queryset with all the fields excluding the `user` and including the output of get_output_field? Please avoid hardcoding. One way is `TransactionEntry

Re: How to use django template tags in .js file ??

2021-06-16 Thread Nikeet NA
Or you can store the url in the variable then use it. On Thursday, 17 June 2021 at 00:29:00 UTC+5:30 Nikeet NA wrote: > Do like this use > var obj_slug = object.slug inside script tag below it include your js file > with the above js script. in js file you can acces it with obj_slug >

Re: CUSTOM AUTH WITH CELERY WORKER FOR SENDING EMAIL

2021-06-16 Thread Nikeet NA
Can you describe in detail , sending mails is possible through celery but i am un clear about auth part. On Wednesday, 16 June 2021 at 22:31:41 UTC+5:30 kuassi...@paydunya.com wrote: > Hello Community. I would like to have recommendations on how to implement > a custom authentication with the

Re: How to use django template tags in .js file ??

2021-06-16 Thread Nikeet NA
Do like this use var obj_slug = object.slug inside script tag below it include your js file with the above js script. in js file you can acces it with obj_slug variable. On Wednesday, 16 June 2021 at 22:31:39 UTC+5:30 kuassi...@paydunya.com wrote: > I also had the problem once. But what I

Re: Local host not opening

2021-06-16 Thread Krish M
Depending on your setup, if your database is pointing to production(Heroku) then the local migrate would be make changes to the Heroku database. If not, you would need to follow best practice below: Django Migrations - Heroku Help On

Re: Adding Two Models In Django

2021-06-16 Thread Ridwan Adeyemo
Thanks man. On Wed, Jun 16, 2021, 5:22 PM Ayush Bisht wrote: > I think you are trying to sum up the value of two model fields and store > them in some other field. > > > so for that u can proceed from base. > > simple you just have to update that field in save method > > for example : >

Re: Local host not opening

2021-06-16 Thread Rhythm Batra
Hey Thanks for your reply. I forgot to add the database url in the settings.py file. I added that and it worked. But I've got a doubt, now I would be working on local host and if I update the models and execute the "python manage.py migrate" command, would the changes be reflected in the

Re: Mobile session issue

2021-06-16 Thread Krish M
Which one are you using? Browser-length-sessions or persistent-sessions? On Tuesday, June 15, 2021 at 6:50:50 PM UTC-4 bhoop...@gmail.com wrote: > Hi team, > > When I am logining from laptop browser then session storing all keys and > respective vales but when I am trying to login from mobile

Re: Local host not opening

2021-06-16 Thread Krish M
Rhythm, The settings must be in uppercase - try changing it to 'PASSWORD' Without seeing your setting.py (without your credential of course) there is no way to debug. On Wednesday, June 16, 2021 at 1:01:52 PM UTC-4 rhythm...@gmail.com wrote: > I created a django website and deployed it on

Re: Desperately need help.

2021-06-16 Thread Ken Smith
Thank you very much they are very much aware that there is a problem with that page and and they seemed not be able to fix it for a week's now. I have contacted them time and time again about it. Actually I am beginning to think that they have at that way on purpose of that they don't have to pay

Local host not opening

2021-06-16 Thread Rhythm Batra
I created a django website and deployed it on heroku and have used aws s3 and amazon RDS Postgres database. Now when i try to run python manage.py runserver in my cmd it gives error - psycopg2.OperationalError: fe_sendauth: no password supplied I have set os.environ.get to name, user, password and

Re: Desperately need help.

2021-06-16 Thread Krish M
Ken, Base on what you're asking, and from the source code (view-source) & screenshot, I don't think you have access to the right code to make the fix. Maybe contacting safewayfx.com and letting them know their platform has a bug? If they are unwilling to fix their backend bug, then there is

Re: How to use django template tags in .js file ??

2021-06-16 Thread Kuassi Israel
I also had the problem once. But what I understood is that the interpretation of the DJANGO syntax in statics files only works when the file has an HTML extension. So if you really want to do something separate with the script you can just create another HTML file but in another folder where

CUSTOM AUTH WITH CELERY WORKER FOR SENDING EMAIL

2021-06-16 Thread Kuassi Israel
Hello Community. I would like to have recommendations on how to implement a custom authentication with the use of CELERY for sending mails which will be QUEUE and managed by a workers that I will start on my server with the BROKER REDIS. Please if anyone have suggestions for me or any articles

Re: Adding Two Models In Django

2021-06-16 Thread Ayush Bisht
I think you are trying to sum up the value of two model fields and store them in some other field. so for that u can proceed from base. simple you just have to update that field in save method for example : *class Student(models.Model):* maths_score = models.DecimalField()

How to use django template tags in .js file ??

2021-06-16 Thread Ayush Bisht
while doing great stuff with django I have found some clumsy behaviour of django in handling .js file. Is there a way to effectively integrate all the stuff of in a separate file and effectively used it with rest of the html code. for example : // *file.html

Re: Adding Two Models In Django

2021-06-16 Thread Ridwan Adeyemo
Please kindly describe with images. On Tue, Jun 15, 2021, 9:52 PM Sebastian Jung wrote: > Hello, > > You create all modelfields inkl. Total sum and after user submit Form with > 2 fields in save() Method you sum both fields together ans write this in > total field... > > Regards > > Ridwan