tracim.models.meta   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
from sqlalchemy.ext.declarative import declarative_base
3
from sqlalchemy.schema import MetaData
4
5
# Recommended naming convention used by Alembic, as various different database
6
# providers will autogenerate vastly different names making migrations more
7
# difficult. See: http://alembic.zzzcomputing.com/en/latest/naming.html
8
NAMING_CONVENTION = {
9
    "ix": "ix_%(column_0_label)s",
10
    "uq": "uq__%(table_name)s__%(column_0_name)s",  # Unique constrains
11
    # TODO - G.M - 28-03-2018 - [Database] Convert database to allow naming convention
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
12
    # for ck contraint.
13
    # "ck": "ck_%(table_name)s_%(constraint_name)s",
14
    "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
15
    "pk": "pk_%(table_name)s"
16
}
17
18
metadata = MetaData(naming_convention=NAMING_CONVENTION)
0 ignored issues
show
Coding Style Naming introduced by
The name metadata does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
19
DeclarativeBase = declarative_base(metadata=metadata)
0 ignored issues
show
Coding Style Naming introduced by
The name DeclarativeBase does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
20