squ1b3r / Djaneiro

Django support for Sublime Text 2/3
MIT License
855 stars 131 forks source link

Red Equal Sign - Python(Django) models.py fields #127

Open diek opened 3 years ago

diek commented 3 years ago

I have been using SBT 4 with Djaneiro and previously with SBT 3 without issue. I recently had to reinstall my OS to Big Sur and since that time if I use Djaneiro for py files it randomly highlights equal signs with red. I am cannot understand why, nor how to resolve it. The only fix is to set the syntax to Python. Why would Djaneiro do this?

Note that I removed all linters in my attempt to solve this.

Update: The problem is isolated to models.py and model fields.

class BaseModel(models.Model):
    created_on = models.DateTimeField(auto_now_add=True, editable=False)
    updated_on = models.DateTimeField(auto_now=True)

    class Meta:
        abstract = True

class Game(BaseModel):
    event = models.CharField(max_length=200)
    expiration_date = models.DateTimeField()
    image = models.ImageField(upload_to='static/images', default='static/images/no-image.jpg')
    result_available = models.BooleanField(default=False)
    short_name = models.CharField(max_length=100)
    question_category = models.ForeignKey(Category, on_delete=models.CASCADE, default=1)
    price = models.FloatField(default=1.50)
    bank = models.IntegerField(default=0)
CleanShot 2021-11-15 at 00 04 28@2x
diek commented 3 years ago

I have tried changing the theme as well, no luck.

class GameUser(AbstractUser):
    username = None
    email = models.EmailField(_("email address"), unique=True)
    is_active_player = models.BooleanField(default=True)

    USERNAME_FIELD = "email"
    REQUIRED_FIELDS = []

    objects = CustomUserManager()

    def __str__(self):
        return self.email

class Quiz(models.Model):
    quiz_name = models.CharField(max_length=50)

    def __str__(self):
        return self.quiz_name
image
scuml commented 2 years ago

What happens when you set the file language to standard "Python" (the one supplied with Sublime).

diek commented 2 years ago

If I switch to Python it is fine.

image