On Thu, Apr 10, 2008 at 10:31 AM, Manuel Meyer <[EMAIL PROTECTED]>
wrote:

>
> Hey,
>
> I have a type Article in which i hold a Type HeaderImage within an
> OneToOneField-Relationship.
> When adding an article via contrib.admin interface everything works
> as expected.
> But if I edit an existing article, the drop-down list doesn't appear
> anymore.
>
> class Article(models.Model):
>     title = models.CharField(_("Full Name"), maxlength=255)
>     header  = models.OneToOneField(HeaderImage)
>
>
> class HeaderImage(models.Model):
>     picture = models.ImageField(null=True, upload_to='./
> images/',core=True)
>     class Admin:
>         pass
>
> What is wrong? Did I miss an option?
>

No, that's they way it is documented as working.  The one-to-one field acts
as the primary key for the model, and primary keys can't be edited.  From
http://www.djangoproject.com/documentation/model-api/#one-to-one-relationships
:

This OneToOneField will actually replace the primary key id field (since
one-to-one relations share the same primary key), and will be displayed as a
read-only field when you edit an object in the admin interface:

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