3👍
✅
blank
is only used with form validation. If you are having records created with empty values you’ll need to write some custom checks to prevent that.
1👍
Have a look at this answer:
class ClientDebt(models.Model):
client_id = models.CharField(max_length=255, blank=False, default=None)
...
blank
will prevent an empty string to be provided in your modeldefault=None
will set name to None when using something likegroup = Group()
, thus raising an exception when callingsave
Alternatively, you may want to have a look at MinLengthValidator.
- [Django]-It's possible to use django mysql model array field
- [Django]-How to write a Django message into your views code
- [Django]-Virtualenv exists but cannot access it from bash script
- [Django]-Serializers in django rest framework with dynamic fields
Source:stackexchange.com