hi,

i'm having a little trouble with templates for my app. here is the
problem: i have title, slug and body field for my model blog. i would
like other users to create blog entries, so i've used generic views
and put this in my urls.py:

(r'^edit/(?P<object_id>\d+)/$',   update_object, dict(model=Komentar,
login_required=True, template_name="komentar/
komentar_edit_form.html")),
(r'^create/$',                    create_object, dict(model=Komentar,
login_required=True, post_save_redirect="/komentar/latest/")),

that work ok, when a user want to create an entry it opens
komentar_form.html and it's displayed right. but when user clicks
submit, it always returns a error for slug field. since user doesn't
write slug field (should be prepopulated, right?), i've put this in my
komentar_form.html:

<input type="hidden" id="slug" name="slug" value="">{% if
form.slug.errors %}<p>arghhh!?!</p>{% endif %}

my question here is, is this html code right? how should slug fields
be presented in html templates? i could find this in django
documentation (about slug fields).

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