title: Using a UUID as a primary key in Django models (generic relations impact)
body: <p>For a number of reasons^, I'd like to use a UUID as a primary key in some of my Django models. If I do so, will I still be able to use outside apps like "contrib.comments", "django-voting" or "django-tagging" which use generic relations via ContentType?</p>
  
  <p>Using "django-voting" as an example, the Vote model looks like this:</p>
  
  <pre><code>class Vote(models.Model):
      user         = models.ForeignKey(User)
      content_type = models.ForeignKey(ContentType)
      object_id    = models.PositiveIntegerField()
      object       = generic.GenericForeignKey('content_type', 'object_id')
      vote         = models.SmallIntegerField(choices=SCORES)
  </code></pre>
  
  <p>This app seems to be assuming that the primary key for the model being voted on is an integer. </p>
  
  <p>The built-in comments app seems to be capable of handling non-integer PKs, though:</p>
  
  <pre><code>class BaseCommentAbstractModel(models.Model):
      content_type   = models.ForeignKey(ContentType,
              verbose_name=_('content type'),
              related_name="content_type_set_for_%(class)s")
      object_pk      = models.TextField(_('object ID'))
      content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk")
  </code></pre>
  
  <p>Is this "integer-PK-assumed" problem a common situation for third-party apps which would make using UUIDs a pain? Or, possibly, am I misreading this situation?</p>
  
  <p>Is there a way to use UUIDs as primary keys in Django without causing too much trouble?</p>
  
  <p><hr/>
  ^ Some of the reasons: hiding object counts, preventing url "id crawling", using multiple servers to create non-conflicting objects, ...</p>