Skip to content

Commit

Permalink
move model definition from apicore to core
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-codecov committed Mar 12, 2024
1 parent 78c11a0 commit 91ab80e
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 18 deletions.
29 changes: 13 additions & 16 deletions shared/django_apps/apicore/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
# Generated by Django 5.0.3 on 2024-03-12 20:16
# Generated by Django 5.0.3 on 2024-03-12 21:20

from django.db import migrations, models
from django.db import migrations


class Migration(migrations.Migration):

initial = True

dependencies = []
dependencies = [
("core", "0001_initial"),
]

operations = [
migrations.CreateModel(
name="Owner",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("username", models.TextField()),
],
name="ProxyOwner",
fields=[],
options={
"proxy": True,
"indexes": [],
"constraints": [],
},
bases=("core.owner",),
),
]
10 changes: 8 additions & 2 deletions shared/django_apps/apicore/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import core.models as shared_core
from django.db import models


class Owner(models.Model):
username = models.TextField()
class ProxyOwner(shared_core.Owner):
@property
def some_property(self):
return self.name

class Meta:
proxy = True


# Create your models here.
28 changes: 28 additions & 0 deletions shared/django_apps/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.0.3 on 2024-03-12 20:16

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = []

operations = [
migrations.CreateModel(
name="Owner",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("username", models.TextField()),
],
),
]
8 changes: 8 additions & 0 deletions shared/django_apps/core/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from django.db import models


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

class Meta:
app_label = "core"


# Create your models 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.core",
"shared.django_apps.apicore",
]

Expand Down

0 comments on commit 91ab80e

Please sign in to comment.