Forms และ Validation
Form Validation Levels
Section titled “Form Validation Levels”Django Forms มี validation หลายระดับที่ทำงานเรียงตามลำดับ:
| Level | Method | Description |
|---|---|---|
| 1 | to_python() | แปลง input เป็น Python type |
| 2 | validate() | Built-in validation |
| 3 | run_validators() | Custom validators |
| 4 | clean_<fieldname>() | Field-specific validation |
| 5 | clean() | Form-level validation |
เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม
ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด
Login with Google