Passed
Push — main ( 4cd557...ac26d8 )
by torrua
01:36
created

loglan_db.model_db.base_author   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 0
1
# -*- coding: utf-8 -*-
2
# pylint: disable=C0303
3 1
"""
4
This module contains a basic Author Model
5
"""
6 1
from loglan_db.model_db import t_name_authors
7 1
from loglan_db import db
8 1
from loglan_db.model_init import InitBase, DBBase
9
10
11 1
class BaseAuthor(db.Model, InitBase, DBBase):
12
    """Base Author's DB Model
13
14
    Describes a table structure for storing information about words authors.
15
16
    Connects with words with "many-to-many" relationship. See `t_connect_authors`.
17
18
    <details><summary>Show Examples</summary><p>
19
    ```python
20
    {'id': 13, 'full_name': 'James Cooke Brown',
21
    'abbreviation': 'JCB', 'notes': ''}
22
23
    {'id': 29, 'full_name': 'Loglan 4&5',
24
    'abbreviation': 'L4',
25
    'notes': 'The printed-on-paper book,
26
              1975 version of the dictionary.'}
27
    ```
28
    </p></details>
29
    """
30
31 1
    __tablename__ = t_name_authors
32
33 1
    id = db.Column(db.Integer, primary_key=True)
34
    """*Author's internal ID number*  
35
        **int** : primary_key=True"""
36
37 1
    abbreviation = db.Column(db.String(64), nullable=False, unique=True)
38
    """*Author's abbreviation (used in the LOD dictionary)*  
39
        **str** : max_length=64, nullable=False, unique=True
40
    Example:
41
        > JCB, L4
42
    """
43
44 1
    full_name = db.Column(db.String(64), nullable=True, unique=False)
45
    """*Author's full name (if exists)*  
46
        **str** : max_length=64, nullable=True, unique=False
47
    Example:
48
        > James Cooke Brown, Loglan 4&5
49
    """
50
51 1
    notes = db.Column(db.String(128), nullable=True, unique=False)
52 1
    """*Any additional information about author*  
53
        **str** : max_length=128, nullable=True, unique=False
54
    """
55