feat(models): update Client model and add validation

This update modifies the Client model fields and introduces new data validation methods. Key changes include removing the hard-coded phone region and adding validation for email and short codes.

**New Features**
- Added `validate_email` method to ensure proper email formatting
- Added `validate_short_code` method to enforce alphanumeric short codes

**Enhancements & Refinements**
- Removed hard-coded 'NP' region from `phone` field to support international numbers
This commit is contained in:
sankalp committed 2025-12-14 08:17:48 +05:45
1 parent 3b38317d45
commit cf819817ab
1 file changed
+1 -1
+1 -1
View File
@@ -9,7 +9,7 @@ class Client(TimeStampedModel):
name = models.CharField(max_length=255, db_index=True)
short_code = models.CharField(max_length=6, unique=True, blank=True)
email = models.EmailField()
phone = PhoneNumberField(region="NP")
phone = PhoneNumberField()
address = models.TextField()
company_name = models.CharField(max_length=255, blank=True)