Working with Foreign Keys - Django Web Development with Python p.10

preview_player
Показать описание
Welcome to part 10 of the web development with Django tutorial series. In this tutorial, we're going to show an example of how we can interact with our various tables linked together by foreign keys.

Рекомендации по теме
Комментарии
Автор

Hello Harrison!

Congratulations and thank you for your videos!
I'm learning a lot.

I would like to give a simple suggestion for solving a small problem that I encountered during encoding.

In the eleventh video, file "mysite/main/views.py", in the implementation of the "single_slug" method, I suggest the creation of the "tut" variable.

Instead of the code being so ...
for m in matching_series.all():
part_one =
series_urls[m] = part_one.tutorial_slug

To become like this ...
for m in matching_series.all():
tut =
if tut.count() > 0:
part_one = tut.earliest("published")
series_urls[m] = part_one.slug

I hope I've helped a bit!
Hugs!
Sincerely.

marvinbraga
Автор

I was waiting for the relationship part and here it comes. Thank

samha
Автор

Im getting 'Tutorial matching query does' when clicking on a series. Any ideas? Error points to line 18; part_one =

gratdane
Автор

I really love this tutorial. I couldn't able to add more tutorialseries. It is showing query not found

adityaturumella
Автор

i have 2 series in my python category..but i am getting one only...but matching series shows 2 .after that series_urls shows one series..can you help me

mycreations
Автор

The Boring Company blow-torch on the wall :)

Jameslauu
Автор

At the end of this I can no longer access any other pages (admin, register, login, logout) as they all route directly to the single_slug view’s HttpResponse(f'{single_slug} does not correspond to anything.' page...

The <single_slug> path is at the bottom of the main/url.py urlpatterns. I’ve tried rearranging the patterns in mysite/urls.py with the “admin/“ route on top (and re-running the server), but for whatever reason Django doesn’t seem to be following the order of routes as expected. Any ideas?

cakethon
Автор

Thank you very much for the videos. Appreciate a lot!
Noted your mug totally smaller than ones on the previous videos series.

erfanhuda
Автор

This is one I was waiting for. Thank you again for these amazing tutorials. 🎓 #sentdex

Himalyanraptor
Автор

Knowingly or unknowingly he's showing off his cups collection. This is part 10 of the series and I saw 10 different cups till now and I really liked the BatMan cup coz it showed some illusion, as if it is hollow, idk :P

ketan_sahu
Автор

until that moment everything was pretty clear, but now I don’t understand anything

alexander_brun
Автор

What about double slugs. If i want to have double_slug instead of single_slug do i need to change models accordingly or is there is any solution which doesn't require change in models. Any help or direction is appreciated

ThRisLive
Автор

hey @sentdex I'm facing a problem I did the same things you did but when I click any series card for example ("Python Basics", it has tutorials) it shows nothing

aymansubbagh
Автор

Hello I hope you are very well
I have a question like first we have to make categories then link to series then tutorial will added
But I want only i have a category and tutorial will added
You also done this part in your website like quantum programming but you didn’t cover in videos .
Please give the solution how to do
Like that:
Category->tutorial

Iamanandraj
Автор

Hey, when you mess up with a migration the best thing to do is to delete the migration file then you can delete the file where you messed up and try again

magralo
Автор

4:57 was not expecting the little mug to show up

Mirceabogdanstanciu
Автор

Hey sentdex you forgot to add path to urls.py 9:49

ibrokhimtoirov
Автор

I always watch out for your coffee cups and I almost fell out of my chair when I saw that tiny little thing

hatch
Автор

while doing:


series_urls[m] = part_one.tutorial_slug, I'm getting an error


Error : AttributeError: 'QuerySet' object has no attribute 'slug'

vinayyadav
Автор

At 22:20 when he displays the website, it shows him all the categories. On my page, it doesn't show any box at all when my tables are filled with categories, series, tutorials! Is anyone facing this issue?

josephblessingh