sets both unique=True and db_index=True attributes on model field, yet
documentation for unique attribute claims thats not necessary:
https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.unique
"Note that when unique is True, you don’t need to specify db_index,
because unique implies the creation of an index."
This gave me small scare, so I'm reporting it to bring it up to the doc
maintainers attention. ;)
--
Ticket URL: <https://code.djangoproject.com/ticket/21730>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_docs: => 0
Comment:
I'm not sure I understand - what exactly about this is scary? It's just
saying that adding db_index=True is redundant if you've also specified
unique=True.
Closing needsinfo; if you can suggest better language, or can provide a
pointer about what exactly is "scary" about the current language, please
reopen.
--
Ticket URL: <https://code.djangoproject.com/ticket/21730#comment:1>
* status: closed => new
* resolution: needsinfo =>
Comment:
Well it's still necessary to remove the redundant db_index. AFAIK it
creates a second index that wastes space without any benefit.
--
Ticket URL: <https://code.djangoproject.com/ticket/21730#comment:2>
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/21730#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"c717ebbfecd248d1a0ffeffa6d167109936fbe3f"]:
{{{
#!CommitTicketReference repository=""
revision="c717ebbfecd248d1a0ffeffa6d167109936fbe3f"
Fixed #21730 -- Removed superfluous db_index in custom auth docs
Thanks rafalp for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21730#comment:4>
Comment (by Claude Paroz <claude@…>):
In [changeset:"5d99cd6877377824a6a5de92475ad0572ab6fb0f"]:
{{{
#!CommitTicketReference repository=""
revision="5d99cd6877377824a6a5de92475ad0572ab6fb0f"
[1.6.x] Fixed #21730 -- Removed superfluous db_index in custom auth docs
Thanks rafalp for the report.
Backport of c717ebbfec from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21730#comment:5>
Comment (by rafalp):
Replying to [comment:1 russellm]:
> I'm not sure I understand - what exactly about this is scary? It's just
saying that adding db_index=True is redundant if you've also specified
unique=True.
It gave me scare because it made me question if my model definitions are
doing what I was thinking they are doing. Rest assured, its not a comment
about quality of documentation or anything like that ;)
--
Ticket URL: <https://code.djangoproject.com/ticket/21730#comment:6>