Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/secore/fieldmappings.py
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-30 04:35:42 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-30 04:35:42 (GMT)
commita31cd062c96fbbd337d181a33b3890d8c2b5f32b (patch)
treee94b10b55d72b00fc5dbcf7658a2cfdc8c95549c /secore/fieldmappings.py
parent4a4283978ffd0e517ef49ccd78704ff328de1393 (diff)
updated secore to latest
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.