Merge branch 'master' into ebook_selling

pull/1/head
eric 2013-08-16 15:50:24 -04:00
commit c88f8165ba
2 changed files with 18 additions and 12 deletions

View File

@ -105,18 +105,24 @@ def makemarc(marcfile, edition):
# change 050 and 082 indicators because LOC is no longer responsible for these # change 050 and 082 indicators because LOC is no longer responsible for these
# no easy indicator change function, so we'll just reconstruct the fields # no easy indicator change function, so we'll just reconstruct the fields
field050 = record.get_fields('050')[0] try:
field050_new = field050 field050 = record.get_fields('050')[0]
field050_new.indicators = [' ', '4'] field050_new = field050
record.remove_field(field050) field050_new.indicators = [' ', '4']
record.add_ordered_field(field050_new) record.remove_field(field050)
record.add_ordered_field(field050_new)
field082 = record.get_fields('050')[0] except:
field082_new = field050 pass # if no 050 field, don't need to change indicator
field082_new.indicators = [' ', '4']
record.remove_field(field082)
record.add_ordered_field(field082_new)
try:
field082 = record.get_fields('082')[0]
field082_new = field082
field082_new.indicators = [' ', '4']
record.remove_field(field082)
record.add_ordered_field(field082_new)
except:
pass # if no 082 field, don't need to change indicator
# add subfield to 245 indicating format # add subfield to 245 indicating format
field245 = record.get_fields('245')[0] field245 = record.get_fields('245')[0]
field245.add_subfield('h', '[electronic resource]') field245.add_subfield('h', '[electronic resource]')

View File

@ -405,7 +405,7 @@
{% for record in edition.MARCrecords.all %} {% for record in edition.MARCrecords.all %}
Download {{record.link_target}} MARC record for this edition: (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&amp;format=xml">XML</a>) (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&amp;format=mrc">mrc</a>)<br /> Download {{record.link_target}} MARC record for this edition: (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&amp;format=xml">XML</a>) (<a href="{% url marc_concatenate %}?record_{{ record.id }}=on&amp;format=mrc">mrc</a>)<br />
{% endfor %} {% endfor %}
{% if user.is_staff and edition.ebooks %} {% if user.is_staff and edition.ebooks.count %}
<a href="{% url MARCUngluify %}?edition={{ edition.id }}">Upload</a> a MARC record for this edition. <br /> <a href="{% url MARCUngluify %}?edition={{ edition.id }}">Upload</a> a MARC record for this edition. <br />
{% endif %} {% endif %}
</div> </div>