Passed
Push — master ( d5e461...9fd0c7 )
by Leon
02:16
created

utils_models   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A create_tables() 0 3 2
1
import datetime
2
3
from peewee import *
4
5
db = SqliteDatabase("rss.db")
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable SqliteDatabase does not seem to be defined.
Loading history...
6
7
8
class BaseModel(Model):
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable Model does not seem to be defined.
Loading history...
9
    class Meta:
10
        database = db
11
12
13
class Rss(BaseModel):
14
    feed = CharField(unique=True)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable CharField does not seem to be defined.
Loading history...
15
    title = CharField(max_length=20)
16
    url = CharField(max_length=255)
17
18
19
class History(BaseModel):
20
    url = CharField(max_length=255)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable CharField does not seem to be defined.
Loading history...
21
    publish_at = DateField(default=datetime.datetime.now)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable DateField does not seem to be defined.
Loading history...
22
23
24
def create_tables():
25
    with db:
26
        db.create_tables([Rss, History])
27