Opened 7 years ago

Closed 7 years ago

Last modified 4 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: UI/UX:



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 7 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from 'ModelName' object has no attribute 'get' when using OneToOneFiel to 'ModelName' object has no attribute 'get' when using OneToOneField

comment:2 Changed 7 years ago by Alex

  • Resolution set to invalid
  • Status changed from new to closed

OneToOne fields are currently not supported in the admin.

comment:3 Changed 4 years ago by jacob

  • milestone 1.0 alpha deleted

Milestone 1.0 alpha deleted

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