I ran into this issue the other day wanting to use a foreign key value to
prepopulate a slugfield  and just getting the id (if anything). According to
the documentation[1] prepopulate doesn't support foreign keys, so I ended up
going the custom javascript route in order to get it working.

--James

[1]http://www.djangoproject.com/documentation/model-api/#slugfield


On Thu, Apr 17, 2008 at 4:11 PM, Jeff Anderson <[EMAIL PROTECTED]>
wrote:

> Merrick wrote:
>
> > I setup the classes below in my model and would like to have access to
> > the name of the state in the City model for use in the SlugField. As
> > it is, I get the state id not the name of the state in the slugfield
> > when I add a City through the admin.
> >
> This is the correct behavior-- It needs to store the id in the database.
> When you say "I get the id" where are you doing this from? A template?
>
> Post the code that you are using to display the information, as your
> models appear to be done correctly.
>
> Jeff Anderson
>
>

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