How to Get Data Out of a Django Model and in to the HTML Template (Django Tutorial) | Part 48

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ต.ค. 2024
  • CORRECTION: I meant auto_now_add=True (only saves a date once) rather than auto_now=True which WILL also update on subsequent saves.
    Enjoyed my video? Leave a like!
    GitHub Link: github.com/max...
    Personal Website: maxgoodridge.com

ความคิดเห็น • 42

  • @veto8172
    @veto8172 2 ปีที่แล้ว +1

    what if i only want to display one post name and date but there is multiple in the database? please help

  • @nplord07
    @nplord07 7 ปีที่แล้ว +2

    Dude loads of thanks!
    Very nice job.
    And believe me, I have checked for lots of Django video tutorials online. But this has worked the best for me. I have followed it on python 3.4 & Django 1.11
    Well Done Max!

  • @ulissesavelar9360
    @ulissesavelar9360 3 ปีที่แล้ว

    Great video man, thanks for sharing. But I have a question, do you have any videos that do the opposite? Get data from a Queryset displayed in the template and save it in the database?

  • @natekleven
    @natekleven 5 ปีที่แล้ว +15

    Great tutorials! The only criticism I have would be to not name your classes POST. This is a bit confusing to newbies that read the code and think you're talking about the HTML post and not your custom class. Otherwise great job!

    • @nurbekfayziev
      @nurbekfayziev 5 ปีที่แล้ว

      totally agree, I was wondering why its named so..)

  • @marryenable
    @marryenable 5 ปีที่แล้ว

    I'm still quite new to OOP I don't understand what are you referring to as "post" here: {{ post.date }} is it the Post class from models.py? Thank you.

  • @morasekhi
    @morasekhi 5 ปีที่แล้ว +3

    Awesome tutorials Max, thank you. I just have one question and that is: how to pass the information we get from forms to an actual Python program which is on the server and then get the results from the python program and send them back to the web page. I'll appreciate if you can give me a hint on this. Thanks

    • @vskreddy8180
      @vskreddy8180 5 ปีที่แล้ว +1

      please tell me the answer ......how can we get from the forms to actual python code

    • @fred.c.johnston
      @fred.c.johnston 4 ปีที่แล้ว

      Views (ARE python code!)

  • @sammathew82
    @sammathew82 ปีที่แล้ว +1

    Great Tutorial!!!

  • @winein1
    @winein1 5 ปีที่แล้ว +2

    Great video. Please, I have browsed everywhere and can't seem to make a dropdown menu populated by a field of the database. Can anyone help please? Thank you in advance.
    I am trying to use ModelChoiceField but I can not find a good and complete example for that.

  • @flipndip5122
    @flipndip5122 4 ปีที่แล้ว

    how do you pass these variables to javascript?

  • @nephtaliceballosflores2780
    @nephtaliceballosflores2780 4 ปีที่แล้ว

    Hey man, you save my day!, Thank you so much, keep doing this please!

  • @chronicsnail6675
    @chronicsnail6675 4 ปีที่แล้ว

    Nice guitar

  • @armanigiles4953
    @armanigiles4953 7 ปีที่แล้ว

    Max saves us all

  • @rezamehdi457
    @rezamehdi457 5 ปีที่แล้ว

    hey
    do you know how kann ich Retrieve Objects of a Database Table in Django --> base.page html

  • @RizwanAli-bu5oy
    @RizwanAli-bu5oy 6 ปีที่แล้ว

    hello max, how to display data from mysql database in hmtl template or bootstrap theme, using django

  • @luckychan0701
    @luckychan0701 5 ปีที่แล้ว

    The charfield gone from the home.html . send help.

  • @akshaysawant9162
    @akshaysawant9162 6 ปีที่แล้ว

    i want to retrive data on existing page after search how i want to do

  • @_.vedant_p
    @_.vedant_p 3 ปีที่แล้ว

    Great video, But is there a way to get data from a Table in HTML to views.py , I want the ID from my table in HTML and fetch the details in database.

  • @icaroamorim3123
    @icaroamorim3123 6 ปีที่แล้ว

    How do I store the value of the form in a variable?

  • @benedictndobole3654
    @benedictndobole3654 4 ปีที่แล้ว

    Wow...this is wonderful guys

  • @ishrahussain6522
    @ishrahussain6522 4 ปีที่แล้ว

    Really helpful thanks man

  • @heidilyons2458
    @heidilyons2458 6 ปีที่แล้ว

    So do you need a form in order to display the model?

  • @shauryashekhar
    @shauryashekhar 4 ปีที่แล้ว

    You are life saver!!😎

  • @jaecheokkim99
    @jaecheokkim99 6 ปีที่แล้ว

    I really appreciate for your nice videos!!!!

  • @aesculapiushealthcareconsu6409
    @aesculapiushealthcareconsu6409 7 ปีที่แล้ว

    Great work Max

  • @colorbars8564
    @colorbars8564 4 ปีที่แล้ว

    You are awesome

  • @kharma777
    @kharma777 5 ปีที่แล้ว

    These are great, thank you!

  • @JaskaranSingh-ro1cz
    @JaskaranSingh-ro1cz 4 ปีที่แล้ว

    class A(models.Model)
    abc = models.CharField(max_length = 10)
    class B(models.Model)
    xyz = models.CharField(max_length = 10)
    a = models.ForeignKey(A, on_delete = models.CASCADE, related_name = "get_a")
    A.objects.all() and get all data from B model also but my i want to implemnt query on A, Not to implement on B ok

  • @macas-academy4712
    @macas-academy4712 4 ปีที่แล้ว

    thank you man !!

  • @bopon4090
    @bopon4090 5 ปีที่แล้ว

    it a weird that you are looking at me.

  • @i_am_a_real_cat1443
    @i_am_a_real_cat1443 4 ปีที่แล้ว

    I'm a timetravell-cat.

  • @SomeCrazyMen
    @SomeCrazyMen 5 ปีที่แล้ว

    Thanks man

  • @muratcopoglu8107
    @muratcopoglu8107 6 ปีที่แล้ว

    Çok güzel anlatıyorsun

  • @surujhossain8654
    @surujhossain8654 5 ปีที่แล้ว

    thanks bro

  • @dev_99999
    @dev_99999 6 ปีที่แล้ว

    Thanks