#7652 closed (invalid)
'ModelName' object has no attribute 'get' when using OneToOneField
Reported by: | 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
- response = callback(request, *callback_args, callback_kwargs)
File "/Library/Python/2.5/site-packages/django/contrib/admin/views/decorators.py" in _checklogin
- return view_func(request, *args, kwargs)
File "/Library/Python/2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
- response = view_func(request, *args, kwargs)
File "/Library/Python/2.5/site-packages/django/contrib/admin/views/main.py" in change_stage
- new_object = manipulator.save(new_data)
File "/Library/Python/2.5/site-packages/django/db/models/manipulators.py" in save
- 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 , 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 , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
OneToOne fields are currently not supported in the admin.