Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#7652 closed (invalid)

'ModelName' object has no attribute 'get' when using OneToOneField

Reported by: ncolon@… Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: OneToOneField AttributeError
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



class LibraryMeta(models.Model):

publish = models.BooleanField(default=True, core=True)

active = models.BooleanField(default=True)

name = models.OneToOneField(Library, edit_inline=models.TABULAR, num_in_admin=1)


Request Method: POST
Django Version: 0.97-pre-SVN-7857
Python Version: 2.5.1

File "/Library/Python/2.5/site-packages/django/core/handlers/" in get_response

  1. response = callback(request, *callback_args, callback_kwargs)

File "/Library/Python/2.5/site-packages/django/contrib/admin/views/" in _checklogin

  1. return view_func(request, *args, kwargs)

File "/Library/Python/2.5/site-packages/django/views/decorators/" in _wrapped_view_func

  1. response = view_func(request, *args, kwargs)

File "/Library/Python/2.5/site-packages/django/contrib/admin/views/" in change_stage

  1. new_object =

File "/Library/Python/2.5/site-packages/django/db/models/" in save

  1. old_rel_obj = getattr(self.original_object, related.get_accessor_name()).get({'%sexact' % rel_new_data[][0]})

Exception Value: 'LibraryMeta' object has no attribute 'get'

Change History (3)

comment:1 Changed 11 years ago by anonymous

Summary: 'ModelName' object has no attribute 'get' when using OneToOneFiel'ModelName' object has no attribute 'get' when using OneToOneField

comment:2 Changed 11 years ago by Alex Gaynor

Resolution: invalid
Status: newclosed

OneToOne fields are currently not supported in the admin.

comment:3 Changed 8 years ago by Jacob

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

Note: See TracTickets for help on using tickets.
Back to Top