Skip to content

Commit

Permalink
Merge pull request #218 from peskk3am/issue161
Browse files Browse the repository at this point in the history
Fixes issue #161
  • Loading branch information
emanueldima committed Apr 1, 2014
2 parents d19cd05 + 5044dc3 commit 1a8f170
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 5 additions & 2 deletions simplestore/lib/simplestore_marc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def add_basic_fields(rec, form, email):
record_add_field(rec, '245', subfields=[('a', remove_html_markup(form['title']))])

if form['creator']:
record_add_field(rec, '100', subfields=[('a', remove_html_markup(form['creator']))])
for kw in form['creator'].split(';'):
if kw and not kw.isspace():
record_add_field(rec, '100', subfields=[('a', remove_html_markup(kw.strip()))])

if form['domain']:
record_add_field(rec, '980', subfields=[('a', remove_html_markup(form['domain']))])
Expand All @@ -67,7 +69,8 @@ def add_basic_fields(rec, form, email):

if form['tags']:
for kw in form['tags'].split(','):
record_add_field(rec, '653',
if kw and not kw.isspace():
record_add_field(rec, '653',
ind1='1',
subfields=[('a', remove_html_markup(kw.strip()))])

Expand Down
13 changes: 7 additions & 6 deletions simplestore/lib/simplestore_model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SubmissionMetadata(db.Model):

id = db.Column(db.Integer, primary_key=True)
description = db.Column(db.Text(), nullable=False)
creator = db.Column(db.String(128))
creator = db.Column(db.String(256)) # split on ;
title = db.Column(db.String(256), nullable=False)
open_access = db.Column(db.Boolean(), default=True)

Expand Down Expand Up @@ -137,10 +137,10 @@ def __init__(self):
'will not be public, however the metadata will be.'
}
self.field_args['contributors'] = {
'placeholder': 'co-author 1; co-author 2; ...',
'placeholder': 'contributor 1; contributor 2; ...',
'description':
'A semicolon separated list of ' +\
'contributors, e.g. further authors. Mention all ' +\
'A semicolon separated list of all other ' +\
'contributors. Mention all ' +\
'other persons that were relevant in the creation of the resource.'
}
self.field_args['language'] = {
Expand All @@ -161,8 +161,9 @@ def __init__(self):
'Any kind of other reference such as a URN, URI or an ISBN number.'
}
self.field_args['creator'] = {
'placeholder': 'The main author of the resource.',
'description': 'The person who created the resource.'
'placeholder': 'author 1; author 2; ... ',
'description':
'A semicolon separated list of authors of the resource.'
}

def _create_metadata_class(cfg):
Expand Down

0 comments on commit 1a8f170

Please sign in to comment.