title: pgtrigger.Q not referencing the foreign key table properly
body: <p>I'm trying to implement a simple <code>pgtrigger.Protect</code> on a table that will do a boolean value check to a foreign key's column. I have written the trigger correctly but when the migration happens, the foreign key's column is not properly referenced. Need help.</p>
  <p><code>User Table</code></p>
  <pre><code>from datetime import datetime as DateTime
  
  from django.db.models import (
      BooleanField, CASCADE, CharField, DateField, DateTimeField, EmailField,
      ForeignKey, IntegerField, JSONField, Model, OneToOneField
  )
  from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
  import pgtrigger
  
  from app.models.user.util.manager import UserAccountManager
  
  
  
  class User(AbstractBaseUser, PermissionsMixin):
  
      class Meta:
          db_table = &quot;user&quot;
          managed = True
          triggers = [
              pgtrigger.SoftDelete(name = &quot;User_SOFTDELETE&quot;, field = &quot;is_active&quot;, value = False)
          ]
  
      id = CharField(
          max_length = 10,
          primary_key = True,
          null = False,
          blank = False,
          unique = True
      )
      account_name = CharField(max_length=50, null=False, blank=False, unique=True)
      dob = DateField(auto_now=False, auto_now_add=False, null=False, blank=False)
      email = EmailField(max_length=50, null=False, blank=False, unique=True)
      password = CharField(max_length=254, null=False, blank=False)
      content_provider = BooleanField(default=False, null=False, blank=False)
  
      is_staff = BooleanField(default=False, null=False, blank=False)
      is_active = BooleanField(default=False, null=False, blank=False)
  
      USERNAME_FIELD = &quot;id&quot;
      REQUIRED_FIELDS = [&quot;account_name&quot;, &quot;dob&quot;, &quot;email&quot;, &quot;password&quot;]
  
      objects = UserAccountManager()
  
      def __str__(self):
          return self.account_name
  
  
  
  class Product(Model):
  
      class Meta:
          db_table = &quot;product&quot;
          triggers = [
              pgtrigger.SoftDelete(name = &quot;Product_SOFTDELETE&quot;, field = &quot;is_active&quot;, value = False),
              pgtrigger.Protect(
                  name = &quot;Product_PROTECT_insert&quot;,
                  operation = pgtrigger.Insert | pgtrigger.Update,
                  when = pgtrigger.Before,
                  condition = pgtrigger.Q(new__id_provider__content_provider = True)
              )
          ]
  
      id = CharField(
          max_length = 20,
          primary_key = True,
          null = False,
          blank = False,
          unique = True
      )
      id_provider = ForeignKey(User, db_column=&quot;id_provider&quot;, on_delete=CASCADE)
    .....
    .....
    .....
  </code></pre>
  <p><code>Migration Error:</code></p>
  <p><code>LINE 45:                 FOR EACH ROW WHEN (NEW.&quot;content_provider&quot;)</code></p>
  <p>In the migration file, it needs to be converted to something like <code>NEW.&quot;user&quot;.&quot;content_provider&quot;</code>. How can I create this trigger properly to a foreign key's column? Need Help</p>