A Simple Many-To-Many Example in Django

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

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

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

    Thank you Chuck, your explanations are very detailed and comprehensive.

  • @FahmiEshaq
    @FahmiEshaq 4 ปีที่แล้ว +4

    Well explained. This video deserves more views

  • @elhalmihamza28
    @elhalmihamza28 ปีที่แล้ว

    thanks, Chuck, you save my life, with this explanation

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

    Excelent! After a long time searching, I found the solution to a problem that I had in my approach to many to many.

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

    There are instances where certain property changes to a field do not get noticed by makemigrations. The easiest solution, since I didn't yet have anything in the database, was to comment it out, migrate, comment it in with the new setting and migrate. Stack overflow had some solutions to write a script by hand (which were not relevant to me just learning).

  • @sdscode
    @sdscode ปีที่แล้ว

    Well that's an important detail in Django Models, according to the documentationm, no Joint Table is required, only consider the ManyToManyField model type (that saves code and logic but is not standard I think). In pure SQL (Database First approach) the Joint table is definitively required, I think.

  • @influensor
    @influensor 2 ปีที่แล้ว

    You are the one I was looking for. thx, I am your fan now!

  • @abdusamadabdullakhanov518
    @abdusamadabdullakhanov518 2 ปีที่แล้ว

    Dude that was clearly explained, I mean, content is great!!! i really appreciate your work and feel free with droppin' your pen, if you managed to take it back, thats okay😅😅😅. All in all thanks for comprehensive video

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

    When I add Author in ManyToManyField it gives me name error name Author is not defined.
    Any solutions for that?

  • @thales-maciel
    @thales-maciel 4 ปีที่แล้ว

    Django docs says we should put the ManyToManyField in one of our models only, but I wasn't able to find out why

    • @nelsonkerandi6324
      @nelsonkerandi6324 4 ปีที่แล้ว +3

      Here is why I think
      Behind the scenes, Django creates an intermediary join table to represent the many-to-many relationship. By default, this table name is generated using the name of the many-to-many field and the name of the table for the model that contains it. Since some databases don’t support table names above a certain length, these table names will be automatically truncated and a uniqueness hash will be used, e.g. author_books_9cdf. You can manually provide the name of the join table using the db_table option.
      docs.djangoproject.com/en/3.1/ref/models/fields/#django.db.models.ManyToManyField

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

    This just saved my life.

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

    thank you so much, very clear and short

  • @TheChronichalt
    @TheChronichalt ปีที่แล้ว

    I think you have the 0..* explanation wrong, I'd like to be corrected if I'm wrong, but the 0..* means that a GENRE can exist without a BOOK, not that a BOOK can exist without a GENRE.

    • @dace9294
      @dace9294 ปีที่แล้ว

      Iam agree with you
      Did you find the correct idea?

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

    Thank you.

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

    Thank you so much !

  • @dace9294
    @dace9294 ปีที่แล้ว

    I run this code with manyToMany and without manyToMany
    And the result was the same
    And i was able to see the result by django-exentions
    Django-exentions can generate graph models base on your models code

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

    Can I email you a complex modeling question?

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

    Beautiful

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

    thank you !!

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

    thanx man