create projects app; move Project model to projects app; recreate migrations because moving the model caused problems o.o
This commit is contained in:
parent
880d2f8db4
commit
a69e436da5
16 changed files with 108 additions and 25 deletions
|
|
@ -1,6 +1,5 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from .models import Project, Issue
|
||||
from .models import Issue
|
||||
|
||||
admin.site.register(Project)
|
||||
admin.site.register(Issue)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 2.1.7 on 2019-03-20 22:34
|
||||
# Generated by Django 2.2.1 on 2019-05-27 12:56
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
|
@ -10,6 +10,7 @@ class Migration(migrations.Migration):
|
|||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('projects', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
|
@ -20,20 +21,7 @@ class Migration(migrations.Migration):
|
|||
('title', models.CharField(max_length=200)),
|
||||
('text', models.TextField(blank=True)),
|
||||
('create_date', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.Project')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Project',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('project_key', models.CharField(max_length=16, unique=True)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
('description', models.TextField(blank=True)),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='issue',
|
||||
name='project',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='issues.Project'),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,7 @@
|
|||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
class Project(models.Model):
|
||||
project_key = models.CharField(max_length=16, unique=True)
|
||||
name = models.CharField(max_length=200)
|
||||
description = models.TextField(blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
from projects.models import Project
|
||||
|
||||
|
||||
class Issue(models.Model):
|
||||
|
|
|
|||
Reference in a new issue