Skip to content

Commit

Permalink
Fixes microsoft#175 Django syncdb removal, and migrations support
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Jan 29, 2016
1 parent 8e8f76c commit 6233189
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
16 changes: 15 additions & 1 deletion Python/Product/Django/Microsoft.PythonTools.Django.targets
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
-->

<PropertyGroup>
<PythonCommands>DjangoShellCommand;DjangoValidateAppCommand;DjangoSyncDbCommand;DjangoCollectStaticCommand;$(PythonCommands)</PythonCommands>
<PythonCommands>DjangoShellCommand;DjangoValidateAppCommand;DjangoMigrateCommand;DjangoCollectStaticCommand;DjangoSyncDbCommand;$(PythonCommands)</PythonCommands>

<StartupPathOrManagePy>$(QualifiedProjectHome)manage.py</StartupPathOrManagePy>
<StartupPathOrManagePy Condition="Exists($(StartupPath))">$(StartupPath)</StartupPathOrManagePy>
Expand Down Expand Up @@ -204,6 +204,20 @@
</CreatePythonCommandItem>
</Target>

<Target Name="DjangoMigrateCommand"
Label="resource:Microsoft.PythonTools.Django;Microsoft.PythonTools.Django.Resources;MigrateLabel"
DependsOnTargets="SetStartupPathOrManagePy"
Returns="@(Commands)">
<CreatePythonCommandItem Target="$(StartupPathOrManagePy)"
TargetType="script"
Arguments="migrate"
WorkingDirectory="$(WorkingDirectory)"
Environment="DJANGO_SETTINGS_MODULE=$(DjangoSettingsModule)"
ExecuteIn="Repl:resource:Microsoft.PythonTools.Django;Microsoft.PythonTools.Django.Resources;CommandReplTitle">
<Output TaskParameter="Command" ItemName="Commands" />
</CreatePythonCommandItem>
</Target>

<Target Name="DjangoSyncDbCommand"
Label="resource:Microsoft.PythonTools.Django;Microsoft.PythonTools.Django.Resources;SyncDbLabel"
DependsOnTargets="SetStartupPathOrManagePy"
Expand Down
13 changes: 11 additions & 2 deletions Python/Product/Django/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Python/Product/Django/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
<data name="DjangoSettingsModuleHelp" xml:space="preserve">
<value>The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used.</value>
</data>
<data name="MigrateLabel" xml:space="preserve">
<value>Django &amp;Migrate... (Django 1.7 and later)</value>
</data>
<data name="OpenDjangoShellLabel" xml:space="preserve">
<value>Open &amp;Django Shell</value>
</data>
Expand All @@ -165,7 +168,7 @@ The web.config file will be configured to resolve URIs matching this pattern to
NOTE: This pattern is applied in addition to the static URI specified in the Django settings module.</value>
</data>
<data name="SyncDbLabel" xml:space="preserve">
<value>Django &amp;Sync DB...</value>
<value>Django &amp;Sync DB... (Django 1.6 and earlier)</value>
</data>
<data name="ValidateAppLabel" xml:space="preserve">
<value>&amp;Validate Django App...</value>
Expand Down

0 comments on commit 6233189

Please sign in to comment.