Django Tutorial for Beginners - 29 - Generic Views

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

This is the most useful and detailed tutorial I have seen so far! Good job!

linyijiang
Автор

Great tutorials man. Keep up the good work but here's a side note. For the IndexView the code is simple enough to just use the default implementation. So instead of overriding get_queryset all you have to do is override the model attribute to use the model you want.

INSTEAD OF:

class IndexView(generic.ListView):
template_name = 'template.html'

def get_queryset(self):
return Album.objects.all()

YOU CAN JUST DO:

class IndexView(generic.ListView):
model = Album
template_name = 'template.html'

And that's it!!!

ALSO(from the Django docs):
" If context_object_name is
not set, the context name will be constructed from the model_name
of the model that the queryset is composed from. For example, the model
Article would have context object named 'article'."

superuseriii
Автор

Well done imitation of designer :)
8:40 - 8:50

corrichyou
Автор

Is it weird that I still think Django is confusing by the time 29 tuts have passed?

angad
Автор

Never everrrr have I seen a clearer explanation of Generic views than this oneeee✨

khushalimal
Автор

Love Django, love Buckey, you're the man, best Django tutorial on the net!

TrustEngineers
Автор

I like your impression of a web designer.

InsaneBastardGuy
Автор

I reflectively hit Ctrl-z on keyboard after you delete all the original views...

ethansun
Автор

model = Album is the same thing as query_set = Album.objects.all and it's the shortcut way of def get_queryset()

MichaelAbebreseAgyeman
Автор

Those Darn Web Designers! Lol I laughed so much at that.

MatthewDickensmjd
Автор

Simply the best programming channel on YT

Loeil
Автор

I felt the generic views as simple rather than the earlier complex Thanks bucky your Tutorials are amazing

parasmalhotra
Автор

Anyone getting this error:
'as_view() takes 1 positional argument but 2 were given'
was caused from omitting the parentheses in the urls.py details as_view....
It should look like this, if you use re_path.
re_path(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'),

tonyiguru
Автор

Thank you, I was missing out on some points and your video took away my doubt.

wesleysartori
Автор

thanks for tutorials ..
quik if out detail view depends on many models not just one???

AlbertStepanyan
Автор

if you want to import reverse, import it from django.urls
from django.urls import reverse

chrisk
Автор

Git's really helpful, when bucky's doing some big changes, you can save a snapshot of that code by commiting.

AbhishekNigam
Автор

very good presentation, you cleared up a troublesome subject for me...thanks

runthomas
Автор

Amazing video thank you I've been looking forever for this!!

couturexolivia
Автор

Finally I understand generic views! :)

iamzumie