djangosnippets.org: Latest snippets tagged with 'ID'https://djangosnippets.org/tags/id_1/2011-07-15T06:25:15.057845-05:00Random object IDs using an abstract base model
2011-07-15T06:25:15.057845-05:00elverhttps://djangosnippets.org/snippets/2490/<p>To put obfuscated primary keys in any class, simply inherit from this one. For example:</p>
<p>class Offer(ObfuscatedPKModel)</p>
<p>You can match for these bigint primary keys in your urls.py like this:</p>
<p>'^offer/(?P<offer_pk>[0-9-]+)$'</p>
Freely redistributable