unique_with nullable foreign key
Issue #13
resolved
Say I have an AutoSlugField(populated_from='title', unique_with='some_relation')
and some_relation
has null=True
. Now the following scenario hold:
title='Hello', some_relation=(1)
, slug becomeshello
title='Hello', some_relation=(2)
, slug becomeshello
title='Hello', some_relation=None
, slug becomeshello-2
The third slug should also hello
, as it is unique within all some_relation=None
.
Comments (2)
-
-
repo owner - changed status to resolved
Solved by @dteskera in PR
#8 - Log in to comment
something like this may help in autoslug/utils.py around line 113 change this code
to this