Slugs, http://www.djangoproject.com/documentation/model-api/#slugfield

On Apr 7, 5:29 pm, garrido <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> Forgive me if this is a stupid question, but here goes: I have started
> my first Django project, and in it I have an object called
> "Categories" defined in my models.  In my urls.py, I have a rule that
> matcheshttp://mysite.com/category/<my category>, and everything up to
> here is fine.  However, category names can sometimes be made up of two
> words, for instance "Web Development", and that's how they get
> inserted in the DB, with whitespace.  So when I pass that in my URL
> (links tohttp://mysite.com/category/<my category> are built
> automatically by Django in the app), I only gethttp://mysite.com/category/Web
> sent in the request.  I could cut the whitespace or replace with an
> underscore, but then of course it won't match what is recorded in the
> DB.
>
> So, what is the correct way to deal with whitespace and Django URLs?
--~--~---------~--~----~------------~-------~--~----~
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