Intro to Django's Annotate

preview_player
Показать описание
This video explains how the annotate feature works in Django with examples.

WORK WITH ME👇🏼

✅ Implement features and fix bugs in your app: Live, one-on-one screenshare
Рекомендации по теме
Комментарии
Автор

your style in videos which is the same as a live video without any cuts is really helpful because it's an educational material as you know
some of us may see it boring
i found it great

mohammadsamir
Автор

Great tutorial, keep it up bro
Greetings from Alexandria, Egypt ❤

omarhafez
Автор

Please also make a video on select_related and pefetch_related

PRASHANTKUMAR-twhd
Автор

Thank you, Anthony, This playlist is amazing, Love From India

abhishekk
Автор

Hey Anthony I am big fan of you,

I watch a lot of your videos, I am about to submit my project and I am struck in deadlock

sizes = Variants.objects.raw('SELECT * FROM products_variants WHERE product_id=%s GROUP BY size_id', [product_id])

I used this query in django and then and when I hosted my project on heroku and use postgress as my database this query didn't worked

I just simply want to find its django equivalent any suggestions mate thanks

ashurkanwal
Автор

How about if I want to get results for one country and it's all cities and do this for all countries that are available and their cities grouped for a particular city

andrewnjaya
Автор

How to use geodesic function with annotate if the latitude and longitude are from the models field.
I tried this;
origin = (lat, lng)
models.objects.annotate(distance=geodesic(origin, (F("latitude"),
This shows a Type Error ;
float() argument must be a string or a number, not 'F'

Please help

irfanwani
Автор

Can you explain how to make join 2 tables without foreignkey using orm

Sai_keshireddy
Автор

can i group the cities by contries? an get as result [las vegas, NY], etc?

darkanoid
Автор

Hey man, in the Bash shell, you might want to try out the key combinations Ctrl-A and Ctrl-E to get around. Was it helpful?

MatheusLegenda
Автор

Hi! How would You ask for the total number of countries that have at least one city in them?

zaganmichal
Автор

Small problem I am having, I will paraphrase it to the tutorial objects:
I have Country objects and City objects.
City objects have calculations that that are not written on database field (simple subtraction between 2 fields on CIties object ).
Can I use annotate to sum together the subtraction values?
I am getting "FieldError: Unsupported lookup 'worked_in_day' for AutoField or join on the field not permitted.", as I am new to Django and databases in general I am unsure if that is because I am trying to sum together datatypes that do not allow it or Django does not support the calculation I want.

robertsivanovs
Автор

Keep up the good work man! Your flask course was awesome!

hirenpatel
Автор

You should use shell_plus from django-extensions.

ulgens
Автор

you are using vars() to convert the ORM object to a dictionary. is this function builtin, or your custom function. if a custom function, how you implemented it?

udhayprakashpethakamsetty
Автор

The course on your site understanding django is using version 1.0 or 2.0?

TusharVasudev
Автор

what 's up man can u do a video on middlewares (how to create a simple login restriction middleware and restriction for pages u cant c when u r logged in )

altair
Автор

Nicely Explained> Thanks Brother <3

maqboolthoufeeqt
Автор

This is going to be a stand-alone video or it's the first of a series?

Skaxarrat
Автор

Can u pls tell me how to do arthimetic operations between the model fields . I have
= x:y:z
in database and I have to do these operations:

x/(x+y+z) : y/(x+y+z) : z/(x+y+z)
Thank u

mohangoud