jpwatts / django-positions

A Django field for custom model ordering.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nice to have a POSITON_START_WITH_ONE

zxygentoo opened this issue · comments

commented

Neat package!
It will be nice to have a POSITON_START_WITH_ONE option of sorts in order to start position index at 1 (now it's zero).
For example this will make url using position more sane and readable.

Thank you.

I went with zero-based numbering so the interface would be the same as Python lists. That said, I agree that I'd rather see one-based numbers in a URL; have you considered doing the translation in a view? I think that's probably where I'd start.

I'm going to go ahead and close this issue, as I'm unlikely to write the code for this myself. But if translating the index in a view is insufficient for what you're trying to accomplish and you're willing to dig into the code, I'd consider a pull request that added this feature without compromising the existing zero-based usage.