Re: Unique and null

2021-04-08 Thread Ryan Nowakowski
On Thu, Apr 08, 2021 at 11:12:51PM +0100, Roger Gammans wrote: > On Thu, 2021-04-08 at 16:36 -0500, Ryan Nowakowski wrote: > > On Wed, Apr 07, 2021 at 03:25:53PM +0100, Roger Gammans wrote: > > > This is mostly (form the Django perspective) and issue with > > > CharFields, > > > because a

Re: Unique and null

2021-04-08 Thread Roger Gammans
On Thu, 2021-04-08 at 16:36 -0500, Ryan Nowakowski wrote: > On Wed, Apr 07, 2021 at 03:25:53PM +0100, Roger Gammans wrote: > > This is mostly (form the Django perspective) and issue with > > CharFields, > > because a CharField can store None or ''. For values of '' > > in CharField, IIRC, django

Re: Unique and null

2021-04-08 Thread Ryan Nowakowski
On Wed, Apr 07, 2021 at 03:25:53PM +0100, Roger Gammans wrote: > This is mostly (form the Django perspective) and issue with CharFields, > because a CharField can store None or ''. For values of '' > in CharField, IIRC, django will convert them to null, with null=True, > blank=True. But not with

Re: Unique and null

2021-04-07 Thread Mike Dewhirst
Many thanksMike--(Unsigned mail from my phone) Original message From: "Ing.Daniel Bojorge" Date: 8/4/21 08:59 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: Unique and null I suggest that if you set unique, the field must have value, so null=False.Bla

Re: Unique and null

2021-04-07 Thread Ing.Daniel Bojorge
igned mail from my phone) > > > > Original message > From: Derek > Date: 7/4/21 23:05 (GMT+10:00) > To: Django users > Subject: Re: Unique and null > > Are you using MySQL? > > > https://stackoverflow.com/questions/371/does-mysql-

Re: Unique and null

2021-04-07 Thread Mike Dewhirst
for responding.CheersMike--(Unsigned mail from my phone) Original message From: Derek Date: 7/4/21 23:05 (GMT+10:00) To: Django users Subject: Re: Unique and null Are you using MySQL?https://stackoverflow.com/questions/371/does-mysql-ignore-null-values-on-unique-constraintsOn Wednesday

Re: Unique and null

2021-04-07 Thread Roger Gammans
: > > Are you using MySQL? > > https://stackoverflow.com/questions/371/does-mysql-ignore-null-values-on-unique-constraints > > > > > > On Wednesday, 7 April 2021 at 08:07:35 UTC+2 Mike Dewhirst wrote: > > > I have just made a CharField unique and Django d

Re: Unique and null

2021-04-07 Thread Roger Gammans
SQL? > https://stackoverflow.com/questions/371/does-mysql-ignore-null-values-on-unique-constraints > > > On Wednesday, 7 April 2021 at 08:07:35 UTC+2 Mike Dewhirst wrote: > > I have just made a CharField unique and Django detects duplicates > > nicely > > > >

Re: Unique and null

2021-04-07 Thread Vkash Poudel
I'm using Postgresql does CharField unique solves problem of uniqueness , can we work with uuid model. On Wed, Apr 7, 2021 at 6:51 PM Derek wrote: > Are you using MySQL? > > > https://stackoverflow.com/questions/371/does-mysql-ignore-null-values-on-unique-constraints > >

Re: Unique and null

2021-04-07 Thread Derek
Are you using MySQL? https://stackoverflow.com/questions/371/does-mysql-ignore-null-values-on-unique-constraints On Wednesday, 7 April 2021 at 08:07:35 UTC+2 Mike Dewhirst wrote: > I have just made a CharField unique and Django detects duplicates nicely > but seems to ignore mu

Re: Unique and null

2021-04-07 Thread Ryan Nowakowski
cates >nicely >but seems to ignore multiple instances where the field value is null. > >     arn = models.CharField( >     max_length=MEDIUM, >     unique=True, >     null=True, >     blank=True, >     ) > >Is this correct behaviour? > >Th

Unique and null

2021-04-07 Thread Mike Dewhirst
I have just made a CharField unique and Django detects duplicates nicely but seems to ignore multiple instances where the field value is null.     arn = models.CharField(     max_length=MEDIUM,     unique=True,     null=True,     blank=True,     ) Is this correct behaviour