-
1
What is cascadeTimes asked 2Official solution
SimpleCascade parent ke saath child pe automatic action (generally delete).
Company delete → uski drives bhi delete, warna orphan rows / FK error.
SQLAlchemy: db.relationship('Drive', cascade='all, delete-orphan', backref='company')
SQL: ForeignKey(..., ondelete='CASCADE')Cascade sirf delete nahi: save-update, merge, refresh-expire, expunge, delete-orphan.
Cascade Update: parent PK change to child FK update (rare, PK mat badlo).
Parent delete jab children active hon: constraint error, ya cascade se children gayab, ya pehle children handle karo — design choice examiner poochta hai.
CSS cascading alag topic hai (styles inherit/override).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
2
lifecycle hooks and where you have used themTimes asked 2Official solution
SimpleLifecycle = component ki zindagi ke stages. API call tab jab DOM ready ho — mounted.
created: instance bani,
thisdata, DOM nahi. mounted/onMounted: page pe aa gaya — fetch, Chart.js, setInterval.
updated: data change ke baad. unmounted: cleanup (clearInterval) warna memory leak.Dashboards onMounted isliye: canvas/API tab valid. created mein $el nahi.
Composition: onMounted(() => {}) setup ke andar.
Example
export default { async mounted() { const r = await fetch('/api/venues') this.venues = await r.json() } }Project example: Venues.vue mounted fetch list. Clock component unmounted pe interval clear.
Viva tipcreated: data setup, DOM nahi. mounted/onMounted: $el mil gaya — fetch yahi. Dashboards isliye onMounted use karti hain.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
3
write an api route to compile the list of completed treksTimes asked 2Official solution
SimpleLive Flask coding: chhota route likho, save, browser/curl se test. Syntax error terminal mein padho.
Example
@app.route('/ping') def ping(): return jsonify(ok=True) @app.route('/even/<int:n>') def even(n): return 'even' if n % 2 == 0 else 'odd'Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet