Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#7652 closed (invalid)

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

Reported by: ncolon@… Owned by: nobody
Component: contrib.admin Version: dev
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

Description

Model:

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)

Environment:

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

Traceback:
File "/Library/Python/2.5/site-packages/django/core/handlers/base.py" in get_response

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

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

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

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

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

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

  1. new_object = manipulator.save(new_data)

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

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

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

Change History (3)

comment:1 by anonymous, 16 years ago

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

comment:2 by Alex Gaynor, 16 years ago

Resolution: invalid
Status: newclosed

OneToOne fields are currently not supported in the admin.

comment:3 by Jacob, 13 years ago

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

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