Completed
Push — master ( e7ede0...eadaef )
by Fox
11s
created

Mastodon.show()   A

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
1
# coding: utf-8
2
from django.db import models
3
from django_th.models import TriggerService
4
from django_th.models.services import Services
5
from django.utils.translation import ugettext_lazy as _
6
7
SCOPES = (
8
     ('home', _('Home')),
9
     ('public', _('Public'))
10
)
11
12
13
class Mastodon(Services):
14
    """
15
        Model for Mastodon Service
16
    """
17
    timeline = models.CharField(max_length=10, default="home", choices=SCOPES)
18
    tooter = models.CharField(max_length=80, null=True, blank=True)
19
    fav = models.BooleanField(default=False)
20
    tag = models.CharField(max_length=80, null=True, blank=True)
21
    since_id = models.BigIntegerField(null=True, blank=True)
22
    max_id = models.BigIntegerField(null=True, blank=True)
23
    count = models.IntegerField(null=True, blank=True)
24
    trigger = models.ForeignKey(TriggerService)
25
26
    class Meta:
27
        app_label = 'th_mastodon'
28
        db_table = 'django_th_mastodon'
29
30
    def show(self):
31
        """
32
33
        :return: string representing object
34
        """
35
        return "My Mastodon %s %s" % (self.timeline, self.trigger)
36
37
    def __str__(self):
38
        return "%s" % self.timeline
39