Thanks a lot, guys!
i'm pretty new to django and i really didn't want to use newforms in
my app. but RajeshD's idea is pretty cool. it just seems that i don't
know how to use slugify().. if you have just a little more time,
please help me for a minute:
i wrote this at the end of my model (for which, slug must be created
after user creates it):
def save(self):
if not self.id:
self.slug = title.slugify()
super(Komentar, self).save()
i've modified slug field for my model so it looks like this:
slug = models.SlugField(blank=True) ... before
models.SlugField(prepopulate_from='title')
correct me if i'm wrong: when user creates an object, an object can't
have slug.. so after first creation of object, i have to trigger
save() method to save it.. and that's where i have prepopulate slug
field. if slug field was required i would always get errors consurning
slug. so, slug field should have blank=True, right?
but anyway, the code doesn't work..
any help is appreciated! thanks, martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---