ON DELETE CASCADE is used to specify that when a row is deleted from the parent table, all rows in the child table that reference the deleted row should also be deleted. This is useful for maintaining the integrity of the database.
38:47 sir debug chahiye aap jaise detail me padhate ho waise hi achha lagata hai please don't change your teaching style even if zyada views na aare ho ya reach ok mil ri ho kyunki detailed videos ki hamesha zarurat rahi h❤❤
Finally, I found a series where I can learn from scratch and practice at the same time. I never comment on online videos, but this one deserves a shot (not just because the instructor asked for comments). Thankeww :)
after having your docs website i can say proudly ki, programming now being indianized, thanks sir for such a valuable docs it helps us alot in our development work.
Sir, please don't get demotivated if you don't get enough reach. I know it's hard to stay consistent. I will try my best to comment on and share every Django video. Sir, you're doing the best job. I cannot trust anyone for Django videos except you, sir. I blindly trust you, sir. I know that you will definitely complete this series, and I will always support you, sir. Stay motivated, sir. We students love you.
Thank you sir .......... In Django, the CASCADE option is used in foreign key relationships to specify that when a referenced object is deleted, all objects that reference it should also be deleted. This is a powerful feature for maintaining referential integrity within your database.
Sir, This is really an amazing course. You are teaching very well. I could not find any free or paid course like this. Please, don't stop making videos.
We need debugging details on the go , please keep it , and the most interesting is as you gave the relation between the code with different files , I love it , it's really helps me to understand how all are interconnected , thanks 😊
Sir Your all videos helps me to motivate and full confidence and this Django series is one of best series whenever I found so far Thanks you soo Much sir I Think paid courses mn bh itna Full in depth bahut rarely sikhaya jata hy but You are an actual Teacher and well guider 😘😘
awesome, Aaj achhe se samajh aya relationship, Debuging se hum logo ko bhi Idea milta hai error ko kaise fix kiya jaye, Aap se request hai ki debuging part ko edit na kare. Thank you
CASCADE in SQL is a keyword used in conjunction with foreign key constraints and it allows for automatic updates or deletions in a child table when changes are made to the parent table. This is particularly useful in maintaining the integrity of data across related tables in a database.
CASCADE ka mtlab databases mein hota hai k jab ek parent record (jaise ek table ka row) ko delete ya update kiya jata hai, toh us par dependent child records (dosre table mein jo us parent record se related hain) ko bhi ussi tarah handle kiya jata hai.
I always have respect to my friend who suggested your main channel Hitesh Choudhury back in 2022 Now from Hitesh to Chai aur code Thank you Sir My favourite line is-"Hey there everyone Hitesh here"
Cascading is used to define operation on foreign key , which allows the operations (delete, update ) in the child table, when changes are done in parent table. There are mainly two types of cascading actions: onUpdate : If I changed the primary key in the parent table (i.e department id) it will propagate to the child table ( and the foreing key particular department _id used in child table (Employee) it will automatically updated. OnDelete: If I delete the entity(student ) of parent table (i.e. RegisterStudent table), then it will automatically delete all the records of the student from child table(i.e course) .
11:00 "cascade" refers to a specific set of actions that are triggered automatically when an event occurs on a referenced row in a parent table. It is often used in the context of referential integrity constraints, specifically within FOREIGN KEY constraints. The two most common types of cascade actions are ON DELETE CASCADE and ON UPDATE CASCADE.
I am a Django + .Net developer, learnt 1 year ago. Built some projects but due to some reason I had to shift to .Net . But I love coding in Django tho. I have strong foundation of python and Django but still following Hitesh sir's course. I really struggled learning it. Thanks a lot for this sir.
#Assignment: Cascade/cascading in DBMS: So basically when a row is deleted from a table and if some other tables are related to that particular table, then their data has to be deleted as well, to maintain the Integrity of the Data stored in DB. mtlb agr parent table ka data delete kia toh child tables ka data bhi delete ho jayega, to maintain integrity of the data. mtlb ek tarah se Domino effect ki tarah h.
"On delete cascade" is a SQL command used when connecting multiple tables using foreign key. When a data from parent table is deleted, the child tables can break but cascade commands prevents it from breaking.
In databases, **CASCADE** is a rule used in foreign key constraints. It automatically updates or deletes related records in child tables when a record in the parent table is updated or deleted.
Cascade: Specifies that if an attempt is made to delete or update a row with a key referenced by foreign keys in existing rows in other tables, all rows containing those foreign keys are also deleted or updated.
Cascade delete is used to automatically delete related data. When a record in a parent table is deleted, all related records in the referenced child table are also automatically deleted.
Debugging Code is just part of development process, seeing you working on it gives us an idea how does debugging the code works. I get such type of bugs even in small projects i build.
CASCADE in SQL is used to simultaneously delete or update an entry from both the child and parent table. The keyword CASCADE is used as a conjunction while writing the query of ON DELETE or ON UPDATE
Chai aur Django mei attendance laga do sir. Video 7 ko already notify mei rakh dia hai, kayi dino se chalta hua ye intezaar aaj kthm hone mei hai. Suna tha aap course videos record krne mei busy the, koi baat nahi humne bhi unn dino beth ke React ko thoda aur seekh lia.... Btana chahunga ki Chai aur backend with Javascript abhi tak maine nahi dekha hai, Django hi mera first Backend work hai, Django ke baare mei aur padha thoda deep mei toh pta chala ki naa toh ye opinionated hai aur naa hi completely unopinioned, Best of both worlds likha tha... Koshish yahi rahegi ki Django ko hindi mei seekhu or Backend with Javascript ko Hitesh Choudary english channel pr seekhu, Usme aapne bola tha ki harr baar aapne bar raise hi kia hai, uss wali series me vo sb toh hogi hi jo isme tha pr Deployment, AWS, Docker vgera bhi cover karne ke plan mei ho. Vaise toh shayad hi tab tak ka intezaar karunga kyunki jab already Chai aur Backend hai toh Intezaar jyada kar paunga ya nhi pta nahi, ek baar Jisse react padh rha hu usse react ho jaye toh Project mei dimaag jyada chalega, Appwrite vagera ke jo aapke projects hain unhe bhi dhyan denge. Chai aur Backend vaha se shuru toh karunga pr tab tak I'm sure kaafi videos aa hi jayengi English channel pr, Itni toh aajayengi ki work kar pau, optimization vagera toh aap baad me btaoge hi shayad Baki freecodecamp vagera toh hai hi, Lage haath git ko bhi thoda brush up kar lunga, 2-3 din hi toh lagenge :)
When you use on_delete=models.CASCADE, it means that if the referenced object (parent) is deleted, all related objects (children) will also be deleted.from django.db import models class Category(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name class Product(models.Model): name = models.CharField(max_length=100) price = models.DecimalField(max_digits=10, decimal_places=2) category = models.ForeignKey(Category, on_delete=models.CASCADE) def __str__(self): return self.name
12:41 Cascade, when we use it when the parent it will delete the children automatically i.e. when we delete a data all the data that is referenced to it will be deleted
The on_delete=models.CASCADE part means that if an Chai instance is deleted, all ChaiReview instances related to that Chai will also be deleted.This industrial practice is used for data integrity , Ensures that there are no orphaned records in the database.
ON DELETE CASCADE is used to specify that when a row is deleted from the parent table, all rows in the child table that reference the deleted row should also be deleted.
Django me "models.CASCADE" ka matlab hai ke jab aik model (parent model) ka object delete hota hai, to us se related doosre model (child model) ke saare objects bhi automatically delete ho jate hain. Yeh ek foreign key relationship ko define karte waqt use hota hai. Detail Explanation Foreign Key Relationship: Django me "ForeignKey" aik field hoti hai jo do models ke darmiyan aik relationship banati hai. Yeh field ek model ko doosre model ke object ke sath link karti hai. models.CASCADE: Jab aap models.CASCADE ko aik ForeignKey me use karte hain, to iska matlab hai ke agar parent model ka object delete ho jata hai, to saare child model ke objects jo is parent model se related hain, wo bhi delete ho jate hain.
CASCADE effect specifies that when the row of parent table is deleted the row from child table that references the row From parent table be deleted. Example: If you delete a chai On delete CASCADE on ChaiReviews will delete all the ChaiReviews associated with that chai
good video. I find it little bit difficult. might watch once more. going to read docs, it might help. Overall, playlist is great. Keep debugging part as it helps us how to debug while building projects.
11:49 in simple words sir cascade e query hai jo tab use ati hai jab user data ko delete kar ta hai aur us time hi jo bhi tables hoti hai us user kae naam ki vo bhi delete ho jati hai
Using models.CASCADE ensures that your database remains consistent by automatically removing dependent records that should not exist without their parent record. This helps maintain referential integrity and prevents orphaned records.
Btw, sir 300K hone wala hai, kuch special treat dijiye❤, 50K se follow kar rha hun aapko, but regret hota hai, ki 100 Subs se kyun nhi recommend kiya youtube aapka channel
class City(models.Model): # define model fields for a city class Property(models.Model): city = models.ForeignKey(City, on_delete = models.CASCADE) # define model fields for a property
CASCADE: When we set the on_delete parameter as CASCADE, deleting the reference object will also delete the referred object. This option is most useful in many relationships. Suppose a post has comments; when the Post is deleted, all the comments on that Post will automatically delete. We don't want a comment saving in the database when the associated Post is deleted.
Docs for this video:
docs.chaicode.com/relationships-and-forms/
Course: courses.chaicode.com/learn
hi sir plz request hai 99 kar do comment target or 150
sir ye series kab tak complete hoga and isme total kitne video honge?
@@binauralbeats-relaxingmusi4336 aaam kho aam ki goothli na gino
give us 9th tutorial. continue the series please
ON DELETE CASCADE is used to specify that when a row is deleted from the parent table, all rows in the child table that reference the deleted row should also be deleted. This is useful for maintaining the integrity of the database.
Thank you for the info.👍
38:47 sir debug chahiye aap jaise detail me padhate ho waise hi achha lagata hai please don't change your teaching style even if zyada views na aare ho ya reach ok mil ri ho kyunki detailed videos ki hamesha zarurat rahi h❤❤
Finally, I found a series where I can learn from scratch and practice at the same time. I never comment on online videos, but this one deserves a shot (not just because the instructor asked for comments). Thankeww :)
Hitesh Sir + Chai aur Code per Django Series + Explanation in Hindi
Ye hai perfect combination
Bhai or comment karva do
I love how you show all the error that you actually face in-between... that same as real situation .. i can connect and feel good thank you so much
after having your docs website i can say proudly ki, programming now being indianized, thanks sir for such a valuable docs it helps us alot in our development work.
I was able to solve many problems only because there is documents. Kudos to you sir!!🙏🙏🙏🙏
Best part of yours videos is you resolve or debug errors in videos that's also important part of learning. Thank you
Sir, please don't get demotivated if you don't get enough reach. I know it's hard to stay consistent. I will try my best to comment on and share every Django video. Sir, you're doing the best job. I cannot trust anyone for Django videos except you, sir. I blindly trust you, sir. I know that you will definitely complete this series, and I will always support you, sir. Stay motivated, sir. We students love you.
sir you made Django easier. your teaching technique is awesome and lead us to dive into deep. thank you sir.
Guys please comment target pura karo, this is the least we can do to appreciate Hitesh sir. Thanks a lot for Django series sir
Bhai mane kar diya bhot sare comment aap bhi karo
I had to complete a Technical Assessment for a job interview, came here. A good kick start !
Thankyou sir !
Thank you sir .......... In Django, the CASCADE option is used in foreign key relationships to specify that when a referenced object is deleted, all objects that reference it should also be deleted. This is a powerful feature for maintaining referential integrity within your database.
Sir, This is really an amazing course. You are teaching very well. I could not find any free or paid course like this. Please, don't stop making videos.
plz everyone do comment on every video of django so that we can get full series, this is how we can show our gratitude towards sir.
We need debugging details on the go , please keep it , and the most interesting is as you gave the relation between the code with different files , I love it , it's really helps me to understand how all are interconnected , thanks 😊
I really enjoy when show us how to debug a specific error. It helps a lot.
Sir Your all videos helps me to motivate and full confidence and this Django series is one of best series whenever I found so far Thanks you soo Much sir I Think paid courses mn bh itna Full in depth bahut rarely sikhaya jata hy but You are an actual Teacher and well guider 😘😘
I have seen and studied a lot of Indian teachers but you are the best sir, keep it up❤love from lahore Pakistan
Thank you for making the documentation so easy to read and learn from. I really appreciate your efforts.
awesome, Aaj achhe se samajh aya relationship,
Debuging se hum logo ko bhi Idea milta hai error ko kaise fix kiya jaye,
Aap se request hai ki debuging part ko edit na kare.
Thank you
CASCADE in SQL is a keyword used in conjunction with foreign key constraints and it allows for automatic updates or deletions in a child table when changes are made to the parent table. This is particularly useful in maintaining the integrity of data across related tables in a database.
CASCADE ka mtlab databases mein hota hai k jab ek parent record (jaise ek table ka row) ko delete ya update kiya jata hai, toh us par dependent child records (dosre table mein jo us parent record se related hain) ko bhi ussi tarah handle kiya jata hai.
I always have respect to my friend who suggested your main channel Hitesh Choudhury back in 2022
Now from Hitesh to Chai aur code
Thank you Sir
My favourite line is-"Hey there everyone Hitesh here"
It's me?
hell mene 20 bar ye vidio dekha hai aur bhot kuch sikha parha hu thank
Cascading is used to define operation on foreign key , which allows the operations (delete, update ) in the child table, when changes are done in parent table.
There are mainly two types of cascading actions:
onUpdate : If I changed the primary key in the parent table (i.e department id) it will propagate to the child table ( and the foreing key particular department _id used in child table (Employee) it will automatically updated.
OnDelete: If I delete the entity(student ) of parent table (i.e. RegisterStudent table), then it will automatically delete all the records of the student from child table(i.e course) .
Sir your lecture is enough for learning and we dont go anywhere to learn Django
11:00 "cascade" refers to a specific set of actions that are triggered automatically when an event occurs on a referenced row in a parent table. It is often used in the context of referential integrity constraints, specifically within FOREIGN KEY constraints. The two most common types of cascade actions are ON DELETE CASCADE and ON UPDATE CASCADE.
One of the finest series of django i've ever seen , loved it sir !!
I am a Django + .Net developer, learnt 1 year ago. Built some projects but due to some reason I had to shift to .Net . But I love coding in Django tho. I have strong foundation of python and Django but still following Hitesh sir's course. I really struggled learning it. Thanks a lot for this sir.
#Assignment:
Cascade/cascading in DBMS:
So basically when a row is deleted from a table and if some other tables are related to that particular table, then their data has to be deleted as well, to maintain the Integrity of the Data stored in DB.
mtlb agr parent table ka data delete kia toh child tables ka data bhi delete ho jayega, to maintain integrity of the data.
mtlb ek tarah se Domino effect ki tarah h.
Finally abb mai apne projects me models sahi kar paaoo ga..❤❤thanks alot sir ji..
"On delete cascade" is a SQL command used when connecting multiple tables using foreign key. When a data from parent table is deleted, the child tables can break but cascade commands prevents it from breaking.
mene pura youtube chhan mara lekin Django ka best containt nahi mila ae best hai sir
In databases, **CASCADE** is a rule used in foreign key constraints. It automatically updates or deletes related records in child tables when a record in the parent table is updated or deleted.
Great day to learn. Love from Nepal 🇳🇵 ❤️
love the debugging process please continue to show us
The best part for me is the error debugging so don't remove that part sir keep introducing us to new errors every time.
Thank you sir it is perfect series for starting learning Django
Thanks for the django series, please keep the debugging in the videos. It helps us a lot.
Please hitesh also build websocket based projects in django your teaching skills are very unique 😊 I am so thankful to you.
Cascade: Specifies that if an attempt is made to delete or update a row with a key referenced by foreign keys in existing rows in other tables, all rows containing those foreign keys are also deleted or updated.
Cascade delete is used to automatically delete related data. When a record in a parent table is deleted, all related records in the referenced child table are also automatically deleted.
Sir you made Django easier!! Thank you so muchhhhhh!
Thank you for sharing the docs as well! They are so much helpful!
Debugging Code is just part of development process, seeing you working on it gives us an idea how does debugging the code works. I get such type of bugs even in small projects i build.
CASCADE in SQL is used to simultaneously delete or update an entry from both the child and parent table.
CASCADE in SQL is used to simultaneously delete or update an entry from both the child and parent table. The keyword CASCADE is used as a conjunction while writing the query of ON DELETE or ON UPDATE
The debugging sections really help a lot, sir
Thankyou Sir
Got to learn so much
Keep making such videos and helping students
Chai aur Django mei attendance laga do sir. Video 7 ko already notify mei rakh dia hai, kayi dino se chalta hua ye intezaar aaj kthm hone mei hai. Suna tha aap course videos record krne mei busy the, koi baat nahi humne bhi unn dino beth ke React ko thoda aur seekh lia....
Btana chahunga ki Chai aur backend with Javascript abhi tak maine nahi dekha hai, Django hi mera first Backend work hai, Django ke baare mei aur padha thoda deep mei toh pta chala ki naa toh ye opinionated hai aur naa hi completely unopinioned, Best of both worlds likha tha... Koshish yahi rahegi ki Django ko hindi mei seekhu or Backend with Javascript ko Hitesh Choudary english channel pr seekhu, Usme aapne bola tha ki harr baar aapne bar raise hi kia hai, uss wali series me vo sb toh hogi hi jo isme tha pr Deployment, AWS, Docker vgera bhi cover karne ke plan mei ho.
Vaise toh shayad hi tab tak ka intezaar karunga kyunki jab already Chai aur Backend hai toh Intezaar jyada kar paunga ya nhi pta nahi, ek baar Jisse react padh rha hu usse react ho jaye toh Project mei dimaag jyada chalega, Appwrite vagera ke jo aapke projects hain unhe bhi dhyan denge. Chai aur Backend vaha se shuru toh karunga pr tab tak I'm sure kaafi videos aa hi jayengi English channel pr, Itni toh aajayengi ki work kar pau, optimization vagera toh aap baad me btaoge hi shayad
Baki freecodecamp vagera toh hai hi, Lage haath git ko bhi thoda brush up kar lunga, 2-3 din hi toh lagenge :)
bhai or comment kar do mane bhi bhot sare comment kare hai and frnds and sabko share kar ke bol do comment karne ko aap bhi
bhai dosto se bhi comment karva lo
Sir, your series are very good and another level. Thank you a lot Sir.
When you use on_delete=models.CASCADE, it means that if the referenced object (parent) is deleted, all related objects (children) will also be deleted.from django.db import models
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Product(models.Model):
name = models.CharField(max_length=100)
price = models.DecimalField(max_digits=10, decimal_places=2)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
def __str__(self):
return self.name
Amazing teaching style. Love it
Best Teaching Method in the World From PK 🥰🥰
Never found a better series on Django than this in Hindi.
12:41 Cascade, when we use it when the parent it will delete the children automatically i.e. when we delete a data all the data that is referenced to it will be deleted
I have learnt js and react from you your content are always great and this django series is mind blowing ❤
Sir u r the best..
We want real world development.. Dont cut it viya..
Yes please keep teaching us how to debug and fix errors as well
The on_delete=models.CASCADE part means that if an Chai instance is deleted, all ChaiReview instances related to that Chai will also be deleted.This industrial practice is used for data integrity , Ensures that there are no orphaned records in the database.
I was looking to learn relationship, best video
2:32 Sir ji comment targt completed agla video please jaldi laye ga❤❤
01💯tahnku sir pls aur video bnaiye sir
sir ji, chai aur docs me kya use kiya hai apne next js ya django, bahut khoobsurat and clean banaya hai
Excited for upcoming video lectures
Sir keep the debugging part that helps to read and understand errors
Hello Hitesh sir! plz don't cut the debugging part in video. I like to see the how you fix the issues
ON DELETE CASCADE is used to specify that when a row is deleted from the parent table, all rows in the child table that reference the deleted row should also be deleted.
35:51 sir please ese hi debugging part ko rakhiye... It's very useful for beginners like me
Django me "models.CASCADE" ka matlab hai ke jab aik model (parent model) ka object delete hota hai, to us se related doosre model (child model) ke saare objects bhi automatically delete ho jate hain. Yeh ek foreign key relationship ko define karte waqt use hota hai.
Detail Explanation
Foreign Key Relationship:
Django me "ForeignKey" aik field hoti hai jo do models ke darmiyan aik relationship banati hai. Yeh field ek model ko doosre model ke object ke sath link karti hai.
models.CASCADE:
Jab aap models.CASCADE ko aik ForeignKey me use karte hain, to iska matlab hai ke agar parent model ka object delete ho jata hai, to saare child model ke objects jo is parent model se related hain, wo bhi delete ho jate hain.
CASCADE effect specifies that when the row of parent table is deleted the row from child table that references the row From parent table be deleted.
Example: If you delete a chai
On delete CASCADE on ChaiReviews will delete all the ChaiReviews associated with that chai
Wow 😲 I am new to this channel and its best django playlist
Best channel i joined today 😃
23:00 Admin panel for models (creating classes in admin)
34:30 Sorting issue
this is the best playlist for django
Sir, you're doing the best job and thank for all of this
Sir aap bas video bante raho... Hum target complete karte rahenge
😅😅thx bro
I prefer more of you videos over docs as its intresting
bhaiya target poora hogya hai please share the next video
😮😮sir bhot accha padhaye hai
Sir ap bhoot acha padhata ho thanks sir
good video. I find it little bit difficult. might watch once more. going to read docs, it might help. Overall, playlist is great. Keep debugging part as it helps us how to debug while building projects.
11:49 in simple words sir cascade e query hai jo tab use ati hai jab user data ko delete kar ta hai aur us time hi jo bhi tables hoti hai us user kae naam ki vo bhi delete ho jati hai
I am loving the documentation!
Best teacher on the TH-cam
Using models.CASCADE ensures that your database remains consistent by automatically removing dependent records that should not exist without their parent record. This helps maintain referential integrity and prevents orphaned records.
Django is fun when learning from hitesh sir :)
Awesome tutorial Hitesh, Thanks so much
Most welcome!
One of the best series on Django
Btw, sir 300K hone wala hai, kuch special treat dijiye❤, 50K se follow kar rha hun aapko, but regret hota hai, ki 100 Subs se kyun nhi recommend kiya youtube aapka channel
class City(models.Model):
# define model fields for a city
class Property(models.Model):
city = models.ForeignKey(City, on_delete = models.CASCADE)
# define model fields for a property
studing django second time, aab dheere dheere samaz aa raha hai....
CASCADE:
When we set the on_delete parameter as CASCADE, deleting the reference object will also delete the referred object. This option is most useful in many relationships. Suppose a post has comments; when the Post is deleted, all the comments on that Post will automatically delete. We don't want a comment saving in the database when the associated Post is deleted.
ye wala comment target kuch zada hi jaldi pura ho gaya. jokes apart, Sir you keep providing and we will keep supporting.
😅vo Mane karvaya tha
Actual seekhne ko to debugging me milta hai. Agar concepts and flow sahi karna hai to errors achy hi hai.
great and most detailed content as always
amazing way of teaching
This is the best django series