Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/secore/fieldmappings.py
diff options
context:
space:
mode:
Diffstat (limited to 'secore/fieldmappings.py')
-rw-r--r--secore/fieldmappings.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/secore/fieldmappings.py b/secore/fieldmappings.py
index 3838ce5..7347448 100644
--- a/secore/fieldmappings.py
+++ b/secore/fieldmappings.py
@@ -76,6 +76,17 @@ class FieldMappings(object):
num = num // 26
return 'X' + ''.join(res)
+ def get_fieldname_from_prefix(self, prefix):
+ """Get a fieldname from a prefix.
+
+ If the prefix is not found, return None.
+
+ """
+ for key, val in self._prefixes.iteritems():
+ if val == prefix:
+ return key
+ return None
+
def get_prefix(self, fieldname):
"""Get the prefix used for a given field name.