Django Tutorial #11 - Model Methods

preview_player
Показать описание
Hey gang, in this Django tutorial I'll show you how we can create model methods in order to output our data in a different way on the page.

----- COURSE LINKS:

======== Other Tutorials =========

----- NODE.JS TUTORIALS

----- MONGODB TUTORIALS

======== Social Links ==========

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

You can add
<p><class = "card-text">{{ article.body|slice:":100" }} {{ '...' }} </p>
in your article_list.html in place of {{ article.body }}

jignathaker
Автор

By far some of the best tutorials I've ever seen - you explain everything clearly and concisely. Thank you!!

brandonlozano
Автор

i learnt django about 6 months ago using your videos. i was stuck at model method, cam back to your video and it all made sense instantly.. thanks

irfanharun
Автор

i dont know who even has the audacity to dislike this mans videos, these are the most helpful videos with the best way of delivering the information. Hats off to you Net Ninja, you are the best!

mopar
Автор

2:24 Small correction. You said putting [:50] will extract the characters from 0 to 50, but actually it will extract from 0 to 49. That's how you'll get the first 50 characters.

mdrafiakhtar
Автор

Having seen other Django videos it has been very useful to pick up new bits of technique in yours, e.g. templates in the "root" app, Model methods etc. Many thanks

iancarr
Автор

Hey Shaun! Love your tutorials. Really hope you will do a series on connecting a django backend to a flutter app

ctd
Автор

I REALLY love this series. I like the short focused segments. Thanks!

dbassett
Автор

For anyone having trouble, make sure to use square brackets [:50] and not round brackets () on the slice/truncate

jamescope
Автор

Was looking for a simple model method in use and I got one.
This is great!
Thanks for the content.

rushas
Автор

Very nice explaining and best for learning

umaretiya
Автор

i think the less dislikes show how this content is good is it

vijay.e
Автор

instead of snippet function we could use

skalippanbalippan
Автор

There is so much functionality in this framework!

joebegleycodes
Автор

Why can we leave out the brackets while calling this method? Thought @property would do this.

naheliegend
Автор

Question, is the snippet method you used a part of python or django or was it just a method you arbitrarily made?

KevinTempelx
Автор

<p }}</p> bro you can use the slice method without the need of creating a new function by the way i like the way you deliver the infos it's so easy and wonderful thank you for everything

jlassichamseddine
Автор

Can someone explain to me what the point of putting the for loop variable article inside the div class? Thanks much!

KevinTempelx
Автор

I also done this but its not work for any reason?
def snippet(self):
return self.body[:50]

shahnooralamnilim
Автор

Why not need to call shippet function ?

Vromvrom