Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Merge ac26290 into af9f3a0
Browse files Browse the repository at this point in the history
  • Loading branch information
lnielsen committed Apr 5, 2016
2 parents af9f3a0 + ac26290 commit 5a4501d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion invenio_marc21/serializers/dojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
class DoJSONSerializer(PreprocessorMixin):
"""Base class for marshmallow serializers."""

def __init__(self, dojson_model):
def __init__(self, dojson_model, replace_refs=False):
"""Initialize record."""
self.dojson_model = dojson_model
super(DoJSONSerializer, self).__init__(replace_refs=replace_refs)

def dump(self, obj):
"""Serialize object with schema."""
Expand Down
6 changes: 4 additions & 2 deletions invenio_marc21/serializers/marcxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ class MARCXMLSerializer(DoJSONSerializer):
records due to high memory usage.
"""

def __init__(self, dojson_model, xslt_filename=None, schema_class=None):
def __init__(self, dojson_model, xslt_filename=None, schema_class=None,
replace_refs=False):
"""."""
self.dumps_kwargs = dict(xslt_filename=xslt_filename) if \
xslt_filename else {}

self.schema_class = schema_class
super(MARCXMLSerializer, self).__init__(dojson_model)
super(MARCXMLSerializer, self).__init__(
dojson_model, replace_refs=replace_refs)

def dump(self, obj):
"""Dump object."""
Expand Down

0 comments on commit 5a4501d

Please sign in to comment.