Alright, well let me get the information out of the way first:

models.py
--------------------------------------------------
char_id             = models.IntegerField('Character ID',
primary_key=True)
name                = models.CharField('Name', maxlength=90)

def get_absolute_url(self):
    return "/characters/%s/" % (slugify(self.name))
--------------------------------------------------

urls.py
--------------------------------------------------
character_detail_dict = {
    'queryset': Character.objects.all(),
    'template_object_name': 'character',
    'template_name': 'characters/character_detail.html',
    'slug_field': 'name',
}

(r'^characters/(?P<slug>[-\w]+)/$',     object_detail,
dict(character_detail_dict)),
--------------------------------------------------

So, the problem. This is an existing database (ran inspectdb to get
it) so obviously I can't add a SlugField to the Character model. Now
I've only been able to get this to work if the character's name is one
word, without hyphens. Once you start throwing hyphens in there, it
throws a 404. I know I'm messing something up, but it's either way too
late for me to think straight, or I just have no idea what to fix. The
thing that bothers me is that `name` isn't really a `slug_field` as it
hasn't been slugified, and the only place I slugify is up there with
the absolute URL. I don't think slug_field can be a property either
correct?

Thanks in advance.

~ Bryan


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to