﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
330	get_relatedobject_count error with OneToOneFields	davidschein@…	Adrian Holovaty	"I have to use ForeignKey instead of OneToOneField lest I receive the following traceback when going to the detail for my object:
""""""
There's been an error:

Traceback (most recent call last):

  File ""C:\django\django\core\handlers\base.py"", line 62, in get_response
    return callback(request, **param_dict)

  File ""C:\django\django\views\admin\main.py"", line 855, in change_stage
    manipulator = mod.ChangeManipulator(object_id)

  File ""C:\django\django\utils\functional.py"", line 3, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))

  File ""C:\django\django\core\meta\__init__.py"", line 1368, in manipulator_init
    count = getattr(self.original_object, 'get_%s_count' % opts.get_rel_object_method_name(rel_opts, rel_field))()

AttributeError: 'Participant' object has no attribute 'get_individual_count'
""""""

My model looks like:
from django.core import meta

class Participant(meta.Model):
    fields = (
        meta.PositiveIntegerField('auction_number', blank=False, null=False, unique=True),
        meta.CharField('address_1', maxlength=50, blank=True),
        meta.CharField('address_2', maxlength=50, blank=True),
        meta.CharField('city', maxlength=30, blank=True),
        meta.USStateField('state', blank=True),
        meta.CharField('zip', maxlength=9, blank=True),
        meta.PhoneNumberField('phone', blank=True),
    )

    def __repr__(self):
        return ""%s"" % (self.id)


class Individual(meta.Model):
    fields = (
        meta.OneToOneField(Participant, edit_inline=meta.TABULAR, num_in_admin=1),
        meta.CharField('first_name', 'First', maxlength=25, core=True),
        meta.CharField('last_name', 'Last', maxlength=25, core=True),
    )

    def __repr__(self):
        return ""%s %s"" % (self.first_name, self.last_name)"	defect	closed	Metasystem		normal	invalid		wojtek@…	Unreviewed	0	0	0	0	0	0
