Sublime Forum

New Django support for ST2

#1

Hi, guys!

Here is my first version of the package for Django with new syntax highlighting in templates, snippets and completions.

This is a small description: github.com/squ1b3r/Djaneiro/blo … README.rst

You can get the code here: github.com/squ1b3r/Djaneiro


Also if you have any suggestion or ideas and pull request, welcome!

Enjoy!
Andrew

Update: Feb 6 !important Changed project structure. If you get some load syntax error, you need delete all *.cache files from the Djaneiro directory.

0 Likes

Django Syntax Highlighting
#2

SWEEET! :smile: Thanks!

0 Likes

#3

Thanks a lot.

Now, i’m working on list of completions for all django API.

0 Likes

#4

Very nice! Keep it up :smile:

0 Likes

#5

Typo:

{ “trigger”: “unique_for_year”, “contents”: “unique_for_month=’$1’” },

This should be “unique_for_year=’$1’”

{ “trigger”: “unique_together”, “contents”: “unique_together = (’$1’,)” },
{ “trigger”: "verbose_name = ", “contents”: “verbose_name = ‘$1’” },
{ “trigger”: “verbose_name_plural”, “contents”: “verbose_name_plural = ‘$1’” },

These have inconsistent spacing between the equals sign compared to the rest of the triggers.

0 Likes

#6

[quote=“lee_connell”]Typo:

{ “trigger”: “unique_for_year”, “contents”: “unique_for_month=’$1’” },

This should be “unique_for_year=’$1’”
[/quote]

Fixed. Thank you!

[quote=“lee_connell”]Typo:

{ “trigger”: “unique_together”, “contents”: “unique_together = (’$1’,)” },
{ “trigger”: "verbose_name = ", “contents”: “verbose_name = ‘$1’” },
{ “trigger”: “verbose_name_plural”, “contents”: “verbose_name_plural = ‘$1’” },

These have inconsistent spacing between the equals sign compared to the rest of the triggers.[/quote]

All triggers without spacing between the equals sign for models arguments, and with spacing between the equals sign for declaration. See this e.g. docs.djangoproject.com/en/dev/re … rbose-name

0 Likes

#7

Check new version please. I’m looking forward to feedback!

0 Likes

#8

Just started using this, and it looks great. Thanks for putting it together!

0 Likes

#9

Works great, thanks for your contribution!

0 Likes

#10

excellent! image of the shortcuts for easy printing would be nice too! :smiley:

0 Likes

#11

Hello. I can’t use this plugin within SublimeCodeIntel…
might you know why ? :smile:

0 Likes

#12

Because CodeIntel reads the current syntax you’re using, and it doesn’t support python-django.

I have an idea how to fix it, maybe i’ll send a pull request to Kronuz this weekend.

Cheers

0 Likes

#13

[quote=“enniot”]Hello. I can’t use this plugin within SublimeCodeIntel…
might you know why ? :smile:[/quote]

I use it with SublimeCodeIntel and there is no problem. Can you give me more details?

0 Likes

#14

I mean that, when I’ve syntax set to Django4ST2 --> Python Django
SublimeCodeIntel doesn’t update library or show completitions. It’s like it’s diabled.

0 Likes

#15

[quote=“enniot”]I mean that, when I’ve syntax set to Django4ST2 --> Python Django
SublimeCodeIntel doesn’t update library or show completitions. It’s like it’s diabled.[/quote]

It’s work for me. But I’m going to rewrite this thing soon.

0 Likes

#16

[quote=“squ1b3r”]

[quote=“enniot”]I mean that, when I’ve syntax set to Django4ST2 --> Python Django
SublimeCodeIntel doesn’t update library or show completitions. It’s like it’s diabled.[/quote]

It’s work for me. But I’m going to rewrite this thing soon.[/quote]

<3 :smile:

0 Likes

#17

however It doesn’t work on both my 2 computers… maybe 3 including the netbook.
All windows 7, 2x64, 1x86. Strange.

New file.
set syntax to Python Django

I type:

from # add a space at the end

Status bar says:
‘unexpected EOF while parsing’ at column 6, Line 1, Column 6

0 Likes

#18

[quote=“enniot”]however It doesn’t work on both my 2 computers… maybe 3 including the netbook.
All windows 7, 2x64, 1x86. Strange.

New file.
set syntax to Python Django

I type:

from # add a space at the end

Status bar says:
‘unexpected EOF while parsing’ at column 6, Line 1, Column 6[/quote]

Yep, I got it too. Thanks man. I’m going to find out later.

0 Likes

#19

If you get some load syntax error after last update, you need delete all *.cache files from the Djaneiro directory.

0 Likes

#20

Another update.

  • Python (Django) is used by default for python files
  • Menu items with default and user settings (for now it’s just setting for syntax files)

Now you can turn off or add new associations for HTML and Python mode in settings files.

0 Likes