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 1649,Attempting to use foreignkey fields in repr definitions does not work in admin,anonymous,Adrian Holovaty,"Let's assume the following models: {{{ class Foo(meta.Model): pass class Bar(meta.model): def __repr__(self): return ""%s (%s)"" % (self.id, self.foo.id) foo = meta.ForeignKey(Foo) }}} This generally raises an AttributeError when django admin attempts to display the models. It seems that the attribute foo is not loaded at that time. Is there some special switch I need to pull, or some special self._ensure_all_dependencies_are_loaded() to call at the repr function?",defect,closed,contrib.admin,,normal,worksforme,,,Unreviewed,0,0,0,0,0,0