def __init__(self, subject, time, event, actions, content_type, using=None, skip=None):
        self.subject = subject
        self.time = time
        self.event = event
        self.content_type = content_type
        self.content_type_field = None
        self.actions = []
        self.append(actions)
        self.using = using

        if self.using:
            self.connection = connections[self.using]
        else:
            self.connection = connection

        try:
            from django.contrib.contenttypes.fields import GenericRelation
        except ImportError:
            from django.contrib.contenttypes.generic import GenericRelation

        if isinstance(subject, models.ManyToManyField):
            self.model = None
            self.db_table = subject.m2m_db_table()
            self.fields = [(subject.m2m_column_name(), ''), (subject.m2m_reverse_name(), '')]

        elif isinstance(subject, GenericRelation):
            self.model = None
            self.db_table = remote_field_model(subject)._meta.db_table
            self.fields = [(k.attname, k.db_type(connection=self.connection)) for k, v in get_fields_with_model(remote_field_model(subject), remote_field_model(subject)._meta) if not v]
            self.content_type_field = subject.content_type_field_name + '_id'

        elif isinstance(subject, models.ForeignKey):
            self.model = subject.model
            self.db_table = self.model._meta.db_table
            skip = skip or () + getattr(self.model, 'denorm_always_skip', ())
            self.fields = [(k.attname, k.db_type(connection=self.connection)) for k, v in get_fields_with_model(subject.model, self.model._meta) if not v and k.attname not in skip]

        elif hasattr(subject, "_meta"):
            self.model = subject
            self.db_table = self.model._meta.db_table
            # FIXME: need to check get_parent_list and add triggers to those
            # The below will only check the fields on *this* model, not parents
            skip = skip or () + getattr(self.model, 'denorm_always_skip', ())
            self.fields = []
            try:
                from django.db.models.fields.related import ForeignObjectRel
            except:
                from django.db.models.related import RelatedObject as ForeignObjectRel
            for k, v in get_fields_with_model(subject, self.model._meta):
                if isinstance(k, ForeignObjectRel):
                    pass
                else:
                    if not v and k.attname not in skip:
                        self.fields.append((k.attname, k.db_type(connection=self.connection)))

        else:
            raise NotImplementedError
dataset/ETHPy150Open django-denorm/django-denorm/denorm/db/base.py/Trigger.__init__/original