Skip to content

Commit

Permalink
Rename (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
aclark4life authored Jan 8, 2025
1 parent 6b422ea commit d346e4e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions mongo_migrations/admin/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import django.contrib.admin.models
import django.db.models.deletion
import django.utils.timezone
import django_mongodb.fields.auto
import django_mongodb_backend.fields.auto
from django.conf import settings
from django.db import migrations, models

Expand All @@ -21,7 +21,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='LogEntry',
fields=[
('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('action_time', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='action time')),
('object_id', models.TextField(blank=True, null=True, verbose_name='object id')),
('object_repr', models.CharField(max_length=200, verbose_name='object repr')),
Expand Down
8 changes: 4 additions & 4 deletions mongo_migrations/auth/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import django.contrib.auth.validators
import django.db.models.deletion
import django.utils.timezone
import django_mongodb.fields.auto
import django_mongodb_backend.fields.auto
from django.db import migrations, models


Expand All @@ -20,7 +20,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Permission',
fields=[
('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, verbose_name='name')),
('codename', models.CharField(max_length=100, verbose_name='codename')),
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype', verbose_name='content type')),
Expand All @@ -38,7 +38,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Group',
fields=[
('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True, verbose_name='name')),
('permissions', models.ManyToManyField(blank=True, to='auth.permission', verbose_name='permissions')),
],
Expand All @@ -53,7 +53,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='User',
fields=[
('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
Expand Down
4 changes: 2 additions & 2 deletions mongo_migrations/contenttypes/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 5.0.9 on 2024-10-04 20:15

import django.contrib.contenttypes.models
import django_mongodb.fields.auto
import django_mongodb_backend.fields.auto
from django.db import migrations, models


Expand All @@ -16,7 +16,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='ContentType',
fields=[
('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('app_label', models.CharField(max_length=100)),
('model', models.CharField(max_length=100, verbose_name='python model class name')),
],
Expand Down
6 changes: 3 additions & 3 deletions project_name/apps.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ from django.contrib.contenttypes.apps import ContentTypesConfig


class MongoAdminConfig(AdminConfig):
default_auto_field = "django_mongodb.fields.ObjectIdAutoField"
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoAuthConfig(AuthConfig):
default_auto_field = "django_mongodb.fields.ObjectIdAutoField"
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoContentTypesConfig(ContentTypesConfig):
default_auto_field = "django_mongodb.fields.ObjectIdAutoField"
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
9 changes: 5 additions & 4 deletions project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""

import django_mongodb
import django_mongodb_backend

from pathlib import Path

Expand Down Expand Up @@ -75,8 +75,9 @@ WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
# Database
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases

DATABASES = {}
DATABASES["default"] = django_mongodb.parse_uri("mongodb://localhost:27017/{{ project_name }}")
DATABASES = {
"default": django_mongodb_backend.parse_uri("mongodb://localhost:27017/{{ project_name }}"),
}

# Password validation
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#auth-password-validators
Expand Down Expand Up @@ -117,7 +118,7 @@ STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django_mongodb.fields.ObjectIdAutoField'
DEFAULT_AUTO_FIELD = 'django_mongodb_backend.fields.ObjectIdAutoField'

MIGRATION_MODULES = {
'admin': 'mongo_migrations.admin',
Expand Down

0 comments on commit d346e4e

Please sign in to comment.