-
-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f6bac6
commit 4c2758c
Showing
25 changed files
with
148 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
mathesar/migrations/0007_rename_database_connection_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by Django 4.2.11 on 2024-06-13 09:05 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import mathesar.models.base | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('mathesar', '0006_mathesar_databases_to_model'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name='Database', | ||
new_name='Connection', | ||
), | ||
migrations.AlterField( | ||
model_name='databaserole', | ||
name='database', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mathesar.connection'), | ||
), | ||
migrations.AlterField( | ||
model_name='schemarole', | ||
name='schema', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mathesar.schema'), | ||
), | ||
migrations.AlterField( | ||
model_name='tablesettings', | ||
name='column_order', | ||
field=models.JSONField(blank=True, default=None, null=True, validators=[mathesar.models.base.validate_column_order]), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
from mathesar.database.base import get_psycopg_connection | ||
from mathesar.models.base import Database | ||
from mathesar.models.base import Connection | ||
|
||
|
||
def connect(db_id, user): | ||
def connect(conn_id, user): | ||
""" | ||
Return a psycopg connection, given a Database model id. | ||
Return a psycopg connection, given a Connection model id. | ||
Args: | ||
db_id: The Django id corresponding to the Database. | ||
conn_id: The Django id corresponding to the Connection. | ||
""" | ||
print("User is: ", user) | ||
db_model = Database.current_objects.get(id=db_id) | ||
return get_psycopg_connection(db_model) | ||
conn_model = Connection.current_objects.get(id=conn_id) | ||
return get_psycopg_connection(conn_model) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.