On Thu, Aug 27, 2009 at 9:55 AM, RubenK <c.min...@gmail.com> wrote:

>
> I've setup my 'prepopulate_fields' so that it should automatically
> enter a slug in the admin site, however when I click the 'add' link
> it gives me the following error:
>
> "Key 'slug' not found in Form"
>
> I've triple checked all my models and database tables and everything
> seems to be in order so I'm sort of stuck now!
> These are my files:
>
> http://dpaste.com/hold/86096/ - models.py
> http://dpaste.com/hold/86098/ - admin.py
>
> Could anyone please assist me?
>

prepopulate_from is just a javascript feature of the admin, so the
javascript needs a field to populate to. If you want to generate a
slug on save and not worry about adding the field to the admin, you
should subclass the save method on the model. I also think you could
make the slug field hidden by adding the attribute in the field.

Just add slug into the fields in the model admin and it will work for you,

Michael

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to