Compare commits
1 Commits
c379ee7d8f
...
ae5a28fadc
Author | SHA1 | Date |
---|---|---|
Tim Van Baak | 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