-
1
Show search functionalityTimes asked 2Official solution
SimpleSearch: form/query param → ilike filter → results template.
Example
q = request.args.get('q', '').strip() lots = Lot.query.filter(Lot.name.ilike(f'%{q}%')).all()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
Open model.py, why have you used lazy=TrueTimes asked 1Official solution
Simplemodels.py = har table ki class: columns, PK/FK, relationships. Yeh Model layer hai.
Suggested flow1) Classes list karo
2) Har table ka kaam 1 line
3) Relationships (1-M / M-M)
4) Constraints (unique, nullable)Example
class Lot(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(80), nullable=False) spots = db.relationship('Spot', backref='lot', lazy=True)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
Tell me about some HTTP methods, GET PATCH etcTimes asked 1Official solution
SimpleHTTP verbs REST ke tools. Methods HTTP ke hain, REST unhe convention se use karta hai.
GET read cacheable. POST create payload. PUT replace. PATCH patch. DELETE remove.
GET exists bina REST ke bhi — browser address bar.
HTTP verbs + status REST ki zabaan. GET read, POST create, PUT replace, PATCH partial, DELETE remove. GET typically no body.
Status: 200 OK, 201 created, 202 accepted (Celery task), 400 bad input, 401 no/bad token, 403 role nahi, 404 missing, 409 conflict (double book), 500 server.
AJAX/fetch page reload nahi. SPA poori isi pe. Postman se bina Vue ke API prove karo — examiner pasand.
Example
GET /api/venues POST /api/venues PUT /api/venues/1 DELETE /api/venues/1Project example: resources.py methods list. Postman 4-5 calls.
Viva tipGET typically no body (cacheable). POST/PUT/PATCH haan payload. PUT idempotent, POST nahi.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet