An Arcpy method for dealing with related records

Idea created by roy_hewitt on Oct 18, 2013
    New
    Score430
    Relationship classes are great because they allow relationships between two datasets to persist between ArcMap sessions.  

    When dealing with relationships in scripts generally I create two separate loops in order to retrieve related records.  The first loop iterates a spatial file's primary key, while a second, nested loop iterates on the tabular file's foreign key.  A list of related records can be created where these two keys match.

    An arcpy method that notes the relationship between the two datasets and allows the user to pull out related records more easily would be helpful.  Perhaps the relationship class could be used as a parameter along with the two datasets since the relationship class already contains the logic for how the two datasets are related.