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).
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.
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
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
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.
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
Thank you Chuck, your explanations are very detailed and comprehensive.
Well explained. This video deserves more views
thanks, Chuck, you save my life, with this explanation
Excelent! After a long time searching, I found the solution to a problem that I had in my approach to many to many.
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).
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.
You are the one I was looking for. thx, I am your fan now!
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
When I add Author in ManyToManyField it gives me name error name Author is not defined.
Any solutions for that?
Django docs says we should put the ManyToManyField in one of our models only, but I wasn't able to find out why
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
This just saved my life.
thank you so much, very clear and short
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.
Iam agree with you
Did you find the correct idea?
Thank you.
Thank you so much !
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
Can I email you a complex modeling question?
Beautiful
thank you !!
thanx man