tmp
This commit is contained in:
parent
29a73c3c47
commit
ae5a28fadc
|
@ -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
|
Loading…
Reference in New Issue