แค่เอาไว้ลดการเขียน arguments ใน router function ให้สั้นลงครับ ถ้าไม่ใช้ model ก็ต้องยัดทั้งหมดลงใน arguments และอีกอย่างก็สามารถเอา model ไป reused ได้ด้วยครับ
Python นี่รับ request เข้ามาตัวแปรเดียวไม่ได้ใช่เปล่าครับ เลยต้องทำแบบนี้ ?
ถ้าเป็น json ส่งมาเป็น object แล้วใช้ model รับแบบนี้ได้เเลย แต่ form data มันมาแบบ field หรืออาจจะมีแล้วหว่ายังไม่ได้อ่าน doc ใหม่ 😂 ครับ
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
แค่เอาไว้ลดการเขียน arguments ใน router function ให้สั้นลงครับ ถ้าไม่ใช้ model ก็ต้องยัดทั้งหมดลงใน arguments และอีกอย่างก็สามารถเอา model ไป reused ได้ด้วยครับ
Python นี่รับ request เข้ามาตัวแปรเดียวไม่ได้ใช่เปล่าครับ เลยต้องทำแบบนี้ ?
ถ้าเป็น json ส่งมาเป็น object แล้วใช้ model รับแบบนี้ได้เเลย แต่ form data มันมาแบบ field หรืออาจจะมีแล้วหว่ายังไม่ได้อ่าน doc ใหม่ 😂 ครับ