How to get all relationshipclass properties using Python

649
3
01-09-2013 04:09 AM
StevePeaslee
Occasional Contributor
I need to get all the properties for a geodatabase relationshipclass. I can use a Python script to get most of the properties via the geoprocessing "Describe" but unless I'm missing something, the names of the primary and foreign key fields aren't exposed to this method.

Can someone please point me in the right direction? There has to be a way.

-Steve
0 Kudos
3 Replies
brettangel
Occasional Contributor II
Did you ever find a solution to this?
0 Kudos
JillianPenney
Esri Contributor
At 10.2.1 release, it will be possible to obtain the origin and destination class keys via python using the Describe function.

You can use:
arcpy.Describe(<relationshipclass>).OriginClassKeys  or
arcpy.Describe(<relationshipclass>).DestinationClassKeys


The result returned will look something like this:
[(u'OBJECTID', u'OriginPrimary', u''), (u'ParcelID', u'OriginForeign', u'')]
[(u'id', u'DestinationPrimary', u''), (u'RenterID', u'DestinationForeign', u'')]


Hope this helps!
0 Kudos
StevePeaslee
Occasional Contributor
Thanks Jill! Just have to be patient I guess.

-Steve
0 Kudos