Skip to content

Commit

Permalink
Make conceptscheme.uri mandatory. Fixes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
koenedaele committed Jul 28, 2016
1 parent d98684e commit f5516bc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* **Minor BC break**: A :class:`skosprovider_sqlalchemy.models.Language` that gets
cast to a string, now returns the language's ID (the IANA language
code),as opposed to the language's description it would previously return.
* **Minor BC break**: The URI attribute has been made required for a
:class:`skosprovider_sqlalchemy.models.ConceptScheme`. Before it was optional,
but it probably would have caused problems with skosprovider anyway.
* Due to the update to skosprovider 0.6.0, a new field `markup`, was added to a
:class:`skosprovider_sqlalchemy.models.Note`. When upgrading from a previous
version of `skosprovider_sqlalchemy`, any databases created in that previous
Expand Down
2 changes: 1 addition & 1 deletion skosprovider_sqlalchemy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class ConceptScheme(Base):
'''
__tablename__ = 'conceptscheme'
id = Column(Integer, primary_key=True)
uri = Column(String(512))
uri = Column(String(512), nullable=False)

labels = relationship(
'Label',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_gen_uri(self):
self.session_maker,
uri_generator=UriPatternGenerator('http://id.example.com/trees/%s')
)
c1 = Concept(concept_id=1, conceptscheme=ConceptScheme(id=99))
c1 = Concept(concept_id=1, conceptscheme=ConceptScheme(id=99, uri='http://id.example.com/trees'))
session = self.session_maker()
session.add(c1)
session.commit()
Expand Down
6 changes: 4 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ def _get_cs(self):
)

return ConceptSchemeModel(
id=68
id=68,
uri='urn:x-skosprovider:cs:68'
)

def test_empty_provider(self):
Expand Down Expand Up @@ -424,7 +425,8 @@ def _get_cs(self):
)

return ConceptSchemeModel(
id=1
id=1,
uri='urn:x-skosprovider:cs:1'
)

def test_empty_provider(self):
Expand Down

0 comments on commit f5516bc

Please sign in to comment.