Completed
Push — master ( 8afb06...675592 )
by Fox
01:11
created

Twitter.clean()   A

Complexity

Conditions 3

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 3
c 1
b 1
f 0
dl 0
loc 9
rs 9.6666

1 Method

Rating   Name   Duplication   Size   Complexity  
A Twitter.__str__() 0 2 1
1
# coding: utf-8
2
from django.db import models
3
from django_th.models.services import Services
4
5
"""
6
    https://dev.twitter.com/rest/public/timelines
7
    https://dev.twitter.com/rest/reference/get/statuses/user_timeline
8
    https://dev.twitter.com/rest/reference/get/search/tweets
9
10
    Twitter model
11
    this permits to search tag or screen
12
    and store the last reached tweet_id with since_id, max_id, count
13
"""
14
15
16
class Twitter(Services):
17
    """
18
19
        Twitter model to store what the kind
20
        of data you want to handle
21
22
    """
23
    tag = models.CharField(max_length=80, null=True, blank=True)
24
    screen = models.CharField(max_length=80, null=True, blank=True)
25
    since_id = models.BigIntegerField(null=True, blank=True)
26
    max_id = models.BigIntegerField(null=True, blank=True)
27
    count = models.IntegerField(null=True, blank=True)
28
    trigger = models.ForeignKey('TriggerService')
29
30
    class Meta:
31
        app_label = 'django_th'
32
        db_table = 'django_th_twitter'
33
34
    def show(self):
35
        """
36
37
        :return: string representing object
38
        """
39
        return "My Twitter %s %s" % (self.screen, self.tag)
40
41
    def __str__(self):
42
        return "%s" % self.screen
43