# Path: channel/models.py
# class Channel(models.Model):
#     name = models.CharField(max_length=30)
#     description = models.TextField()
# 
#     def __str__(self):
#         return self.name


from django.db import models
from channel.models import Channel


class Trigger(models.Model):
    name = models.CharField(max_length=50)
    description = models.TextField()
    channel = models.ForeignKey(Channel)
    klass = models.CharField(max_length=50)

    def __str__(self):

# Path: channel/models.py
# class Channel(models.Model):
#     name = models.CharField(max_length=30)
#     description = models.TextField()
# 
#     def __str__(self):
#         return self.name


# Path: trigger/models.py
from django.db import models
from channel.models import Channel



class Trigger(models.Model):
    name = models.CharField(max_length=50)
    description = models.TextField()
    channel = models.ForeignKey(Channel)
    klass = models.CharField(max_length=50)

    def __str__(self):

        return "{0} - {1}".format(self.channel.name, self.name)