Commits

Anonymous committed 1280c2c

* Experimental sql_app that adds some mssql specific manage.py commands.
** dbgui - launches SQL Management Studio to your project's DB

Comments (0)

Files changed (6)

Add a comment to this file

source/sql_app/__init__.py

Empty file added.

Add a comment to this file

source/sql_app/management/__init__.py

Empty file added.

Add a comment to this file

source/sql_app/management/commands/__init__.py

Empty file added.

source/sql_app/management/commands/dbgui.py

+from django.core.management.base import NoArgsCommand
+
+class Command(NoArgsCommand):
+    help = "Launches SQL Server Management Studio (on Windows)."
+
+    requires_model_validation = False
+
+    def handle_noargs(self, **options):
+        from django.conf import settings
+        import os
+
+        args = ['-nosplash', '-E']
+        
+        host = settings.DATABASE_OPTIONS.get('host', settings.DATABASE_HOST)
+        db = settings.DATABASE_OPTIONS.get('db', settings.DATABASE_NAME)
+        # user = settings.DATABASE_OPTIONS.get('user', settings.DATABASE_USER)
+        # passwd = settings.DATABASE_OPTIONS.get('passwd', settings.DATABASE_PASSWORD)
+        # port = settings.DATABASE_OPTIONS.get('port', settings.DATABASE_PORT)
+    
+        if host:
+            args += ['-S', host]
+
+        if db:
+            args += ["-d", db]
+
+        os.execvp('sqlwb.exe', args)

source/sqlserver_ado/base.py

         self.introspection = DatabaseIntrospection(self)
         self.validation = BaseDatabaseValidation()
         
-            
+
     def _cursor(self, settings):
         # Connection strings courtesy of:
         # http://www.connectionstrings.com/?carrier=sqlserver

tests/test_standardapps/settings.py

     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
+    'sql_app',
 )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.