Code Duplication    Length = 25-26 lines in 4 locations

th_pocket/models.py 1 location

@@ 6-31 (lines=26) @@
3
from django_th.models.services import Services
4
from django_th.models import TriggerService
5
6
7
class Pocket(Services):
8
    """
9
10
        Pocket model to store how you want
11
        to store url in your account
12
13
    """
14
    tag = models.CharField(max_length=80, blank=True)
15
    url = models.URLField(max_length=255)
16
    title = models.CharField(max_length=80, blank=True)
17
    tweet_id = models.CharField(max_length=80, blank=True)
18
    trigger = models.ForeignKey(TriggerService)
19
20
    class Meta:
21
        app_label = 'th_pocket'
22
        db_table = 'django_th_pocket'
23
24
    def show(self):
25
        """
26
27
        :return: string representing object
28
        """
29
        return "My Pocket %s" % self.url
30
31
    def __str__(self):
32
        return "%s" % self.url
33

th_evernote/models.py 1 location

@@ 6-30 (lines=25) @@
3
from django_th.models.services import Services
4
from django_th.models import TriggerService
5
6
7
class Evernote(Services):
8
    """
9
10
        Evernote model to store all notes
11
12
    """
13
    tag = models.CharField(max_length=80, blank=True)
14
    notebook = models.CharField(max_length=80)
15
    title = models.CharField(max_length=80)
16
    text = models.TextField()
17
    trigger = models.ForeignKey(TriggerService)
18
19
    class Meta:
20
        app_label = 'th_evernote'
21
        db_table = 'django_th_evernote'
22
23
    def show(self):
24
        """
25
26
        :return: string representing object
27
        """
28
        return "My Evernote %s" % self.title
29
30
    def __str__(self):
31
        return "%s" % self.title
32

th_pelican/models.py 1 location

@@ 6-30 (lines=25) @@
3
from django_th.models.services import Services
4
from django_th.models import TriggerService
5
6
7
class Pelican(Services):
8
9
    """
10
        pelican model
11
    """
12
    title = models.CharField(max_length=80)
13
    url = models.URLField()
14
    tags = models.CharField(max_length=200, blank=True)
15
    category = models.CharField(max_length=200, blank=True)
16
    path = models.CharField(max_length=255)
17
    trigger = models.ForeignKey(TriggerService)
18
19
    class Meta:
20
        app_label = 'th_pelican'
21
        db_table = 'django_th_pelican'
22
23
    def show(self):
24
        """
25
26
        :return: string representing object
27
        """
28
        return "My Pelican %s" % self.name
29
30
    def __str__(self):
31
        return '%s' % self.name
32

th_wallabag/models.py 1 location

@@ 6-30 (lines=25) @@
3
from django_th.models.services import Services
4
from django_th.models import TriggerService
5
6
7
class Wallabag(Services):
8
    """
9
10
        wallabag model to be adapted for the new service
11
        to store url in your account
12
13
    """
14
    url = models.URLField(max_length=255)
15
    title = models.CharField(max_length=80, blank=True)
16
    tag = models.CharField(max_length=80, blank=True)
17
    trigger = models.ForeignKey(TriggerService)
18
19
    class Meta:
20
        app_label = 'th_wallabag'
21
        db_table = 'django_th_wallabag'
22
23
    def show(self):
24
        """
25
26
        :return: string representing object
27
        """
28
        return "My Wallabag %s" % self.url
29
30
    def __str__(self):
31
        return "%s" % self.url
32