Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
diek opened this issue Nov 15, 2021 · 3 comments
Open

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

diek opened this issue Nov 15, 2021 · 3 comments

Comments

@diek
Copy link

diek commented Nov 15, 2021

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 diek closed this as completed Nov 21, 2021
@diek diek reopened this Nov 22, 2021
@diek
Copy link
Author

diek commented Nov 22, 2021

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

@diek diek changed the title Red Equal Sign Red Equal Sign - Python(Django) models.py fields Nov 22, 2021
@scuml
Copy link
Contributor

scuml commented Aug 12, 2022

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

@diek
Copy link
Author

diek commented Aug 24, 2022

If I switch to Python it is fine.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants