Great content! Finally a video with the right pace, relevant information and without tons of pause sounds ("umm...", "so...") Good job man. Looking forward for this kinda stuff
When working with a model form, how to handle the additional fields in the table defined by the though argument? I display the many-to-many relationship with checkboxs and for each option I'd like to be able to set the additional fields value (a quantity field)
an amazing explanation. thanks a lot. but is it possible how to display data on web if you have a many to many relation? if you have a course explaining that, it will be great... Thanks for the wonderful lesson.
in minute 8, when I run migrate, I got an error: ValueError: Cannot alter field erp.Group.teams into erp.Group.teams - they are not compatible types (you cannot alter to or from M2M fields, or add or remove throu gh= on M2M fields) In my case, I'm working with Team and Group models. Thanks
Hi Anthony thank you for this, it’s really well explained. One question. How do I query all the students enrolled for a particular course before a specific date?
Hey Anthony! How would you make the authentication of a project that have both Rest API and Web pages? For example, let's suppose that there is an API for getting data that should be plotted in some graph, but this will be used both in an Android app and in a page rendered by the Flask, but to access the dashboard it's needed to be logged
Hello Sir...! I have two models A and B which having many to many relation and form third model E with extra attributes . so i want to perform following sql query using django : select * from A , B , E where A.id = E.id and B.id = E.id and A.id = '107'; how i can do..? A.objects().filter(e__aid=107) geves me only content from A model. Plzz Help..!
Good tutorial thanks. By the way I have a question I want to ask regarding forms how is the dynamic form on django-quiz achieved. Where questions come after one another with options. For the answer. Thanks.
I suppose Ajax could make what you ask. Simply POST data from a field, make a function that check that field constantly so you don't have to put a button to POST data. It's better with a GET request rather than POST, but the idea it's the same
Hey, Any clue why we can't display the M2M-field as its normally displayed in the admin area? Gotta use the tabular or stackinline which is kind of annoying.
hey, is there any way to add more than two columns of same class model to another model having many to many relationship. Eg, let say we have a Employee model which contains a recursive relationship with a column say manager, and we want a table named Dispute which is having manyToManyField with these two columns. How this can be done?
Thank you very much for the great tutorial! I have one question. Instead of putting in the 'through=enrollment' argument in courses, is it okay to add it in students?
Hi, Good content mate. One question: I know django creates a default id as primarykey in manytomany table. I want to have a custom primary key to the manytomany table. How to do it?
For anyone playing around with the through-relationship, think long and hard about it. You can't easily change it once you've made the migration. it comes with an error, even if you uncomment all your models, that says "Cannot alter field xxx.xxx.xxx into yyy.yyy.yyy they are not compatible types (you cannot alter to or from M2M fields, or add or remove through= on M2M fields)". I still haven't found a solution although I am not alone on the internet to have experienced this fault
Join my free course on working with the database and models in Django: prettyprinted.com/djangodata
Sir can you please make a video on deployment of django app on Azure?
Hi Anthony, How can I do this with Flask and Flask-SQLAlchemy
Great content! Finally a video with the right pace, relevant information and without tons of pause sounds ("umm...", "so...")
Good job man. Looking forward for this kinda stuff
Dude you solved three problems in a single video. Thanks
Seriously you explained it so well. Thank you
Wow...I never used a 3rd model till now....definitely going to try this....Thank you
Excellent. Exactly what I'm looking for. Thanks for the effort.
Excelent. Thanks for that. I was looking for something like this to solve a problem in my code.
When working with a model form, how to handle the additional fields in the table defined by the though argument? I display the many-to-many relationship with checkboxs and for each option I'd like to be able to set the additional fields value (a quantity field)
Exactly what i was looking for. Very well explained. Thanks. Do you have a full course ?
I believe so. Chek his site
Thank you for this video, you are a gent!
an amazing explanation.
thanks a lot.
but is it possible how to display data on web if you have a many to many relation?
if you have a course explaining that, it will be great...
Thanks for the wonderful lesson.
Mind blowing ! It gave me exactly what I need. thank You !
in minute 8, when I run migrate, I got an error:
ValueError: Cannot alter field erp.Group.teams into erp.Group.teams - they are not compatible types (you cannot alter to or from M2M fields, or add or remove throu
gh= on M2M fields)
In my case, I'm working with Team and Group models.
Thanks
Getting the same error
Clear and helpfull, for beginers
this video helped me a lot
Hi Anthony thank you for this, it’s really well explained. One question. How do I query all the students enrolled for a particular course before a specific date?
excelent video i like how your explain this stuff
Really helpful! Thank you!
Awesome as always
Thank you very much . I finally found a great video 10/10
Nice video ! Thx Anthony
I think the "create" method does automatically the "save" for you ;)
Hey Anthony! How would you make the authentication of a project that have both Rest API and Web pages? For example, let's suppose that there is an API for getting data that should be plotted in some graph, but this will be used both in an Android app and in a page rendered by the Flask, but to access the dashboard it's needed to be logged
thanks! this help me a lot
Hello Sir...!
I have two models A and B which having many to many relation and form third model E with extra attributes .
so i want to perform following sql query using django :
select * from A , B , E where A.id = E.id and B.id = E.id and A.id = '107';
how i can do..?
A.objects().filter(e__aid=107)
geves me only content from A model.
Plzz Help..!
Good tutorial thanks. By the way I have a question I want to ask regarding forms how is the dynamic form on django-quiz achieved. Where questions come after one another with options. For the answer. Thanks.
I suppose Ajax could make what you ask. Simply POST data from a field, make a function that check that field constantly so you don't have to put a button to POST data. It's better with a GET request rather than POST, but the idea it's the same
when you already have data you do not want to delete the whole model :) wolud be nice to mention how to migrate from m2m to separate table
Hey,
Any clue why we can't display the M2M-field as its normally displayed in the admin area? Gotta use the tabular or stackinline which is kind of annoying.
I get thia problem too. Can you solve the problem?
We can use through to customise many to many relationship in django
Thank you, this was the best
Glad you liked it. Thanks for watching!
@@prettyprinted Can you please do a video on how to create a form using the many-to-many through model? Thank you!
I have a complex project and ı dont wan to drop tables. Is there any way for this?
hey, is there any way to add more than two columns of same class model to another model having many to many relationship.
Eg, let say we have a Employee model which contains a recursive relationship with a column say manager, and we want a table named Dispute which is having manyToManyField with these two columns.
How this can be done?
Thank you very much for the great tutorial!
I have one question. Instead of putting in the 'through=enrollment' argument in courses, is it okay to add it in students?
Great Video!
just wondering why did you have to comment the two table of Student, Course in order to create Enrollment?
Amazing tutorial !
i am not getting table when click on show table, could you please help
Hi, Good content mate.
One question: I know django creates a default id as primarykey in manytomany table. I want to have a custom primary key to the manytomany table. How to do it?
How would I select the variable "final_grade" through the ORM?
i.e. "anthony.course_set.first().final_grade" --does not work.
Any suggestions?
anthony.enrollment_set.values('final_grade')
docs.djangoproject.com/en/3.0/ref/models/querysets/#values
@@RuslanSkiraUkraine Thank you. that helped!
using the through argument, how do I render say student name to templates?
thx for the video )
It's very good. Thank you
Hey man love your vids!!
Can you make a video on your thoughts on django 3 and asynchronous features?
Can it be as node async???
I think this is redundant work. As we are already defining three model. Then what is the advantage of manytomany field.
Thanks.
How to add existing field of a model to a new model
Nice bro
Thabks man!
*Thanks
For anyone playing around with the through-relationship, think long and hard about it. You can't easily change it once you've made the migration. it comes with an error, even if you uncomment all your models, that says "Cannot alter field xxx.xxx.xxx into yyy.yyy.yyy they are not compatible types (you cannot alter to or from M2M fields, or add or remove through= on M2M fields)". I still haven't found a solution although I am not alone on the internet to have experienced this fault
💛💛💛💛
print('like '*100)