jpwatts / django-positions

A Django field for custom model ordering.
BSD 3-Clause "New" or "Revised" License
284 stars 71 forks source link

Nice to have a POSITON_START_WITH_ONE #14

Closed zxygentoo closed 11 years ago

zxygentoo commented 11 years ago

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.

jpwatts commented 11 years ago

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.