Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Negative values for primary key #92

Closed
dbrgn opened this issue Apr 28, 2013 · 1 comment
Closed

Negative values for primary key #92

dbrgn opened this issue Apr 28, 2013 · 1 comment

Comments

@dbrgn
Copy link

dbrgn commented Apr 28, 2013

With an integer field as primary key, model mommy sometimes generates negative numbers. Negative numbers seem to break Django's reverse() function.

Is this on purpose? If no, can we fix it? If yes, is there a way to suppress negative integers for primary keys?

Or is it even a bug in Django's reverse() function?

@dbrgn
Copy link
Author

dbrgn commented Apr 28, 2013

Oh, it was my fault. The problem is not reverse of course, but that my url definitions were missing the -? prefix :/

Solution: (<?P<pk>\d+) -> (<?P<pk>-?\d+)

@dbrgn dbrgn closed this as completed Apr 28, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant