Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


format_field() in #9

merged 1 commit into from

2 participants


Hi Ed,

I made a minor change to the format_field method in that I thought I would share in case it is helpful to others.

format_filed() will now ignore subfield 6 when called. This eliminates getting formatted field strings that contain the pointers to 880 fields with foreign scripts. It was returning stings like "880-01 Fu, Jin, 1956-" or "880-02 Xin Zhongguo xi ju shi".

I added a subfield 6 in test/ to verify that it's doing what I intended.

Thanks for your work on the library. I use it often.

Ted Lawless

@edsu edsu merged commit a4ef9b2 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 5, 2010
  1. In format_field() will now ignore subfield 6, which is a poi…

    Ted Lawless authored
    …nter to linked 880 fields.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +2 −0  pymarc/
  2. +4 −2 test/
2  pymarc/
@@ -179,6 +179,8 @@ def format_field(self):
fielddata = ''
for subfield in self:
+ if subfield[0] == '6':
+ continue
if not self.is_subject_field():
fielddata += ' %s' % subfield[1]
6 test/
@@ -97,9 +97,11 @@ def test_is_subject_field(self):
self.assertEqual(self.field.is_subject_field(), False)
def test_format_field(self):
- self.assertEqual(self.subjectfield.format_field(),
+ self.subjectfield.add_subfield('6', '880-4')
+ self.assertEqual(self.subjectfield.format_field(),
'Python (Computer program language) -- Poetry.')
- self.assertEqual(self.field.format_field(),
+ self.field.add_subfield('6', '880-1')
+ self.assertEqual(self.field.format_field(),
'Huckleberry Finn: An American Odyssey')
def test_tag_normalize(self):
Something went wrong with that request. Please try again.