Passed
Pull Request — master (#90)
by
unknown
02:32
created

models   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

1 Function

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