[EMAIL PROTECTED] wrote:
> I've been refactoring some stuff to use slugs, and it looks like
> FreeComment needs an object.id
>
> Is this correct or have I missed something?
>
> Derek

The FreeComment model assumes the primary key of the object it refers
to is an integer, so you can't make the primary key of your model a
slug, but you can still use a slug on your model:

class Post(models.Model):
    slug = models.SlugField(prepopulate_from=('title',), unique=True)
    title = models.CharField(maxlength=80)
    ...

Since I have slug as 'unique=True' rather than 'primary_key=True'
Django will auto-generate an integer primary key field ('id').
-Dave


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to