This commit is contained in:
Tim Van Baak 2021-06-02 18:08:56 -07:00
parent 29a73c3c47
commit ae5a28fadc
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
"""
Membership query interface
"""
from amanuensis.db import DbContext, ArticleIndex, IndexType
from amanuensis.errors import ArgumentError
def create(
db: DbContext,
lexicon_id: int,
index_type: IndexType,
pattern: str,
logical_order: int,
display_order: int,
capacity: int) -> ArticleIndex:
"""
"""
new_index = ArticleIndex(
lexicon_id=lexicon_id,
index_type=index_type,
pattern=pattern,
logical_order=logical_order,
display_order=display_order,
capacity=capacity,
)
db.session.add(new_index)
db.session.commit()
return new_index

0
tests/test_index.py Normal file
View File