django-tables2 icon indicating copy to clipboard operation
django-tables2 copied to clipboard

ModelTable: Resolving database query strings should work with instance._meta

Open miracle2k opened this issue 13 years ago • 0 comments

Currently, if a table column refers to a reverse accessor of a OneToOne relation, it is required that each row actually has a related instance. A missing related instance would raise an exception instead of assuming a NULL value.

Rather than just reversing through the object attributes, django-tables should look at instance._meta at which database fields have actually been defined. If it determines that a reverse OneToOne accessor exists, but no corresponding attribute does, it would then just assume a null value rather than raising an exception.

See the issue described here in more detail: http://stackoverflow.com/questions/4877160/django-tables-and-following-a-one-to-one-relationship-backwards-through-a-related

miracle2k avatar Feb 03 '11 12:02 miracle2k