samirelanduk / django-random-id-model

A model base class which creates long, random, integer primary keys.
7 stars 2 forks source link

Use PositiveBigIntegerField instead of BigIntegerField #3

Closed pakal closed 7 months ago

pakal commented 7 months ago

Nice module, thanks !

Some fixture generators like Django-Baker will prefill this ID with random negative values, breaking e.g. URL resolution (because it expects a positive integer in the regex of placeholders of URLs)

So the simplest would be to use PositiveBigIntegerField, also allowing tiny optimizations at DB level maybe.

(Of course this can still be overridden at subclass level, so it's not very blocking)

samirelanduk commented 7 months ago

Yeah this is better I think - thanks.