mirror of
https://github.com/tjsga/studyguides.git
synced 2025-04-05 03:40:16 -04:00
Merge branch 'master' of github.com:tjsga/studyguides into master
This commit is contained in:
commit
bb1a2e3137
|
@ -16,8 +16,6 @@ class Course(models.Model):
|
|||
id = models.AutoField(primary_key = True)
|
||||
name = models.CharField(max_length=100, unique = True)
|
||||
|
||||
units = models.ManyToManyField("Guide", related_name="course")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
@ -25,6 +23,7 @@ class Guide(models.Model):
|
|||
id = models.AutoField(primary_key = True)
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
course = models.ForeignKey(Course, on_delete=models.CASCADE, null=True)
|
||||
url = models.URLField(max_length=300)
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.1.2 on 2020-10-15 13:34
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('courses', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='course',
|
||||
name='units',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='guide',
|
||||
name='course',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='courses.course'),
|
||||
),
|
||||
]
|
Loading…
Reference in New Issue
Block a user