No video

Learn the basics of Django's Model Managers and Querysets

  Рет қаралды 44,543

Matt Freire

Matt Freire

Күн бұрын

Пікірлер: 46
@technotommy7002
@technotommy7002 4 жыл бұрын
Bro. Your Django skill's is just awesome. It's like you are giving us paid course in free. Thanks man. God bless you.
@abualasif
@abualasif 3 жыл бұрын
certified
@MadRad1000
@MadRad1000 Жыл бұрын
Thank you, there are lots of Django tutorials on writing queries in the terminal, But it can be hard to find practical implementation ... you nailed it, perfectly clear now.
@zorojuro5106
@zorojuro5106 4 жыл бұрын
You explain it to the point thanks dude, bless you, what ever you do u ll succeed
@Zzzzzzzzzzzzzzzzzzzzr
@Zzzzzzzzzzzzzzzzzzzzr 5 жыл бұрын
well done you should be at djangocon giving speeches.. well done brother.
@deep433
@deep433 5 жыл бұрын
you deserve at least 100k subscribers, really loved it......
@ibrahime2193
@ibrahime2193 3 жыл бұрын
+1
@leadstn
@leadstn 5 жыл бұрын
please make a tutorial on how to deploy django channels on DigitalOcean and thank you for your great content
@talanky
@talanky 2 жыл бұрын
Great explanation and example thanks
@samiulsalehin1560
@samiulsalehin1560 3 жыл бұрын
Thank you for this great tutorial. So far I've been searching, there are only custom queries using get, filter, etc. performed on any custom model manager. If my model name is 'SimpleModel' and the manager's name is 'SimpleModelManager', then what is the translation of 'SimpleModel,objects.all()' into the 'SimpleModelManager'?
@mohammadmonirhossain6261
@mohammadmonirhossain6261 4 жыл бұрын
Omg!!!!!!! Don't know how to thank enough
@tarassavchenko2317
@tarassavchenko2317 3 жыл бұрын
Your tutorials are gorgeous, thank you)
@ygcjayalal
@ygcjayalal 3 жыл бұрын
wonderful...fantastic tutorial ..thank you so much... if you can, please do a tutorial about Django class base view please
@Sure_Math_Center
@Sure_Math_Center Жыл бұрын
Nice video
@codybontecou
@codybontecou 5 жыл бұрын
Great video and explanation. It was exactly what I was looking for. Could you please link the documentation for this video and future content. I enjoy your explanations but sometimes it's nice to have a quick reference to where you are getting your information.
@maxvinella941
@maxvinella941 5 жыл бұрын
Great tutorial! thanks
@VitaminCode
@VitaminCode 3 жыл бұрын
I was unable to find your Django Website project on github
@MagnusAnand
@MagnusAnand 3 жыл бұрын
Excellent video!
@tobidegnon4409
@tobidegnon4409 4 жыл бұрын
Hi, how is your vscode editor configured when you are using django, or can you do a video about plugins or tips for vscode related to django
@MagnusAnand
@MagnusAnand 3 жыл бұрын
Let me see if I understood correctly: You have the Model and you have the logic in the custom QuerySet. Then you implement a custom Manager that is the interface between the model and the QuerySet. Is this correct? Model Manager QuerySet ¿¿??
@ibrahime2193
@ibrahime2193 3 жыл бұрын
good content, great future.
@solo8003
@solo8003 5 жыл бұрын
very very nice and useful, can you help in how i can make only post author can edit or delete posts by model manger ?
@mattfreire
@mattfreire 5 жыл бұрын
That is something you configure with user permissions, not in a model manager.
@collynchristopherbrenner3245
@collynchristopherbrenner3245 3 жыл бұрын
Is there a way to not hard code the admin and editor_dude users into the view so as to make it dynamic? I'm trying to use a button to go from a project in Project model to its corresponding issue pulled from Issue model but I ma having a hard time passing the pk/id of the selected project to the following page that it links to which is supposed to display the issues of that project. (I don't know if a manager is what I need to use to do that or if there is a simpler solution, like a method that can grab the pk/id of the project from the address that the page links to (which I know you can do with PHP)).
@AlexWinkler
@AlexWinkler 4 жыл бұрын
Awesome video. How would one filter for the current user? Trying: class PortfolioManager(models.Manager): def get_queryset(self): return super().get_queryset().filter(user=self.request.user) Getting Error: 'PortfolioManager' object has no attribute 'request'
@diegoman8158
@diegoman8158 3 жыл бұрын
Almost a year late, but you could add an extra parameter to the method you are writing: models.py from django.db import models from django.conf import settings class OwnerManager(models.Manager): def owner(self, user): return self.filter(owner = user) class Text(models.Model): title = models.CharField(max_length=30, null=True) description = models.TextField(null=True) owner = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE ) objects = OwnerManager() views.py from django.views.generic import ListView from .models import Text class TextListOwner(ListView): model = Text def get_queryset(self): return self.model.objects.owner(self.request.user)
@TomiMcl
@TomiMcl 5 жыл бұрын
What is the difference adding methods in a custom manager or as a method in the model class?
@praveenm5723
@praveenm5723 4 жыл бұрын
readability and scalable
@abhishek9044855265
@abhishek9044855265 4 жыл бұрын
Can we call django custom query manager from html template , in my case i am sending model class from views and in template i am trying to access model.objects.mycustommethod but it is throwing error by saying cant call manager method on model object instances . I am importing Post model from model.py to views.py then sending Post from views to html templates in context .
@Nadeemkhan-fs2ys
@Nadeemkhan-fs2ys 5 жыл бұрын
make a tutorial on complete crud operation in django in one video .. please
@mattfreire
@mattfreire 5 жыл бұрын
Am planning on it this year
@Nadeemkhan-fs2ys
@Nadeemkhan-fs2ys 5 жыл бұрын
@@mattfreire Thank you... Please quickly as soon as possible
@ravirsn9322
@ravirsn9322 5 жыл бұрын
go and try on javatpoint .... Easy to understand
@allenjack5340
@allenjack5340 5 жыл бұрын
what extensions did you use to make vs code suggesting django imports ? thanks for the explanation and keep it up please
@mattfreire
@mattfreire 5 жыл бұрын
+Allen Jack you can check the github project for the settings file in the .vscode folder. That file specifies the virtualenv directory which then suggests imports for you
@user-de8ih7hs2e
@user-de8ih7hs2e 5 жыл бұрын
Cool!
@xyzmoral262
@xyzmoral262 5 жыл бұрын
Thanks
@radeonblue1816
@radeonblue1816 2 жыл бұрын
What is the difference between QuerySet and manager? Can't I use just the class that inherits from Manager rather then using QuerySet? What is the disadvantage of this approach.
@laticalamonzi2814
@laticalamonzi2814 5 жыл бұрын
thnx!
@salmanmanzoorgorssi4114
@salmanmanzoorgorssi4114 3 жыл бұрын
From where i can get this code
@redred582
@redred582 5 жыл бұрын
i need the code for learn.. can u share to me?
@MagnusAnand
@MagnusAnand 3 жыл бұрын
I can't find the source code in your github :o
@Akash-jz2vf
@Akash-jz2vf 4 жыл бұрын
I think if you go a little bit slower, it will be more understandable and easy to follow for some.
@AlexWinkler
@AlexWinkler 4 жыл бұрын
Amazing tutorial, I've been stuck so long on this SOF question I posted trying to filter my get_content_data and moving all those variable calculations to a manager seems to be the answer. Will post my solution here when I get it, Thanks! stackoverflow.com/questions/61973937/django-filter-queryset-show-variables-on-template
@alexanderdecember8743
@alexanderdecember8743 4 жыл бұрын
Join previous comments!dont know how to thank
Learn the Basics of Django Signals
22:37
Matt Freire
Рет қаралды 50 М.
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 49 МЛН
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 3,7 МЛН
🩷🩵VS👿
00:38
ISSEI / いっせい
Рет қаралды 26 МЛН
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 6 МЛН
How to Use the Related Name Attribute in Django
10:56
Pretty Printed
Рет қаралды 23 М.
Django Class Based Views Tutorial
31:34
Matt Freire
Рет қаралды 46 М.
Django tutorial - How to improve your Django admin
18:20
Matt Freire
Рет қаралды 52 М.
How to use annotate and aggregate on Django querysets
15:13
Django Guardian | Object Level | View and Templates
29:28
Very Academy
Рет қаралды 10 М.
Understanding Django Model Relationships
25:56
Pretty Printed
Рет қаралды 94 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 354 М.
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 49 МЛН