Re: Security issue in django.db.models

2020-08-10 Thread Juan Díaz
Thanks for the answers! El dom., 9 ago. 2020 a las 11:16, Liu Zheng () escribió: > All the previous answers are great to explain the reason. Just want to > add: if you do not desire empty string in form and in shell, you probably > need to add a min_length validation condition > > On Sun, Aug 9,

Re: Security issue in django.db.models

2020-08-09 Thread Liu Zheng
All the previous answers are great to explain the reason. Just want to add: if you do not desire empty string in form and in shell, you probably need to add a min_length validation condition On Sun, Aug 9, 2020 at 12:42 PM Stephen J. Butler wrote: > If you look at the documentation for 'blank'

Re: Security issue in django.db.models

2020-08-08 Thread Stephen J. Butler
If you look at the documentation for 'blank' it says: """ Note that this is different than null. null is purely database-related, whereas blank is validation-related. If a field has blank=True, *form validation* will allow entry of an empty value. If a field has blank=False, the field will be

Re: Security issue in django.db.models

2020-08-07 Thread ule...@gmail.com
Null value is not the same as an empty string !!! You have to validate the robot_name see also : https://stackoverflow.com/questions/6940499/how-can-you-create-a-non-empty-charfield-in-django Op vrijdag 7 augustus 2020 om 15:11:48 UTC+2 schreef neera...@gmail.com: > It basically sets a null

Re: Security issue in django.db.models

2020-08-07 Thread neeraj garg
It basically sets a null value i.e. "" for the fields that you don't pass while creating an object in shell. And "" it acceptable value. If you want to restrict "" then add some validations. On Fri, Aug 7, 2020, 5:16 PM Juan D. wrote: > I've created a model with null and blank set to False in

Security issue in django.db.models

2020-08-07 Thread Juan D.
I've created a model with null and blank set to False in robot_name: class Robot(models.Model): robot_name = models.CharField(max_length=200, null=False, blank=False) version = models.CharField(max_length=20, blank=True, null=True) class Meta: unique_together = ('robot_name',