On Mon, Sep 22, 2008 at 11:51 AM, Jason <[EMAIL PROTECTED]> wrote:

>
> Could someone help with this?
>
> The admin panel is automatically generating my model. This is my
> model.
>
> title = models.CharField(...)
> parent = models.CharField(..., null = True)
>
> The admin panel is currently displaying 2 text input boxes.
>
> What I want to display is a single text input box for the title field
> and a dropdown box containing "" and an array of  titles as the parent
> field.
>
> To make it clearer.
>
> Title : # Text Input Box
> Parent: # Dropdown containing category titles.
>
> The question is how do I do this. I am new to Django and have waded
> through the ModelAdmin documentation but just can't get this going.
>
> Any ideas on how I can achieve this?
>

It rather sounds like a better fit for what you want to achieve is for your
'parent' field to be a ForeigKey to self instead of an independent
CharField.  Assuming your model's __unicode__ function returns the 'title'
field you'll get exactly what you are looking for in the admin interface
without any special customization.

Karen

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