Am Sonntag, 23. September 2007 schrieb Alex Koshelev:
> Slug is very good when you want to create "fine" urls. You can convert
> (using prepopulate_from param) your title field of entry to slug and
> use it for entry's permalink.
> But of course you can use entry's id(integer value) for url mapping

If I understand correctly I prepopulate my slug field with the value from the 
title field (I understand you that it is the other way around).

Anyway... does the slug field guarantees that the URL is unique?

Regards,

Florian

> On 23 сент, 17:12, Florian Lindner <[EMAIL PROTECTED]> wrote:
> > Hello,
> > I am about to develop a blogging application for my site (it's also a
> > learning Django app, so please don't point me to existing projects ;-)
> >
> > Since I do want to omit to change my entire app due to mistakes I had
> > made while designing the model I would like to discuss my concept here
> > before starting to develop.
> >
> > Right now the app should support only one Blog so there is only one
> > model: BlogEntry:
> >
> > class BlogEntry(models.Model):
> >     title = models.CharField(max_length=100)
> >     content = models.TextField()
> >     creationDate = models.DateTimeField(auto_now_add=True)
> >
> > eventually I will add an FileField or ImageField for attachments.
> > What about the Slug Field. I've read the docs but I'm not sure if it
> > makes any sense here? How is it used normally?
> >
> > Another point is how to build an URL to identify a BlogEntry instance. I
> > could use the automatically added id field, like: xgm.de/blog/132286302.
> > Are the ids usually usable directly as part of the URLs or are there any
> > potential non-usable characters? I know this depends on the DB backend.
> > Development will be done on sqlite, production use on MySQL.
> > This is what I prefer ATM.
> >
> > Of couse I will also use a date based generic view to provide a archive
> > view on the blog.
> >
> > Another possibility would be to take the content field into account when
> > constructing the URL: xgm.de/blog/My_first_entry. To make it unique I
> > could prepend or append an unique random id or a part of the date.



--~--~---------~--~----~------------~-------~--~----~
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