Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE demo cross-app model extension #151

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
3 changes: 3 additions & 0 deletions shared/django_apps/api_core/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions shared/django_apps/api_core/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ApiCoreConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "api_core"
25 changes: 25 additions & 0 deletions shared/django_apps/api_core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 5.0.3 on 2024-03-12 01:24

from django.db import migrations


class Migration(migrations.Migration):

initial = True

dependencies = [
("core", "__first__"),
]

operations = [
migrations.CreateModel(
name="Owner",
fields=[],
options={
"proxy": True,
"indexes": [],
"constraints": [],
},
bases=("core.owner",),
),
]
Empty file.
12 changes: 12 additions & 0 deletions shared/django_apps/api_core/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.db import models

from shared.django_apps.shared_core.models import Owner as SharedOwner


class Owner(SharedOwner):
@property
def get_name(self):
return self.username

class Meta:
proxy = True
3 changes: 3 additions & 0 deletions shared/django_apps/api_core/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions shared/django_apps/api_core/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
1 change: 1 addition & 0 deletions shared/django_apps/dummy_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"shared.django_apps.pg_telemetry",
"shared.django_apps.ts_telemetry",
"shared.django_apps.rollouts",
"shared.django_apps.api_core",
]

MIDDLEWARE = []
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions shared/django_apps/shared_core/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions shared/django_apps/shared_core/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class SharedCoreConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "shared_core"
Empty file.
8 changes: 8 additions & 0 deletions shared/django_apps/shared_core/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.db import models


class Owner(models.Model):
username = models.TextField()

class Meta:
app_label = "core"
3 changes: 3 additions & 0 deletions shared/django_apps/shared_core/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions shared/django_apps/shared_core/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
Loading