Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
d65f9b5e
Unverified
Commit
d65f9b5e
authored
4 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Add `on_delete` to ForeignKey and OneToOne fields
parent
e5418b04
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!10
Upgrade Django to current LTS version
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
program/migrations/0001_initial.py
+8
-8
8 additions, 8 deletions
program/migrations/0001_initial.py
program/models.py
+58
-83
58 additions, 83 deletions
program/models.py
with
66 additions
and
91 deletions
program/migrations/0001_initial.py
+
8
−
8
View file @
d65f9b5e
...
@@ -130,11 +130,11 @@ class Migration(migrations.Migration):
...
@@ -130,11 +130,11 @@ class Migration(migrations.Migration):
(
'
automation_id
'
,
models
.
IntegerField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'
Automation ID
'
,
choices
=
[])),
(
'
automation_id
'
,
models
.
IntegerField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'
Automation ID
'
,
choices
=
[])),
(
'
created
'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'
created
'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'
last_updated
'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'
last_updated
'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'
broadcastformat
'
,
models
.
ForeignKey
(
related_name
=
'
shows
'
,
verbose_name
=
'
Broadcast format
'
,
to
=
'
program.BroadcastFormat
'
)),
(
'
broadcastformat
'
,
models
.
ForeignKey
(
related_name
=
'
shows
'
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'
Broadcast format
'
,
to
=
'
program.BroadcastFormat
'
)),
(
'
hosts
'
,
models
.
ManyToManyField
(
related_name
=
'
shows
'
,
verbose_name
=
'
Hosts
'
,
to
=
'
program.Host
'
,
blank
=
True
)),
(
'
hosts
'
,
models
.
ManyToManyField
(
related_name
=
'
shows
'
,
verbose_name
=
'
Hosts
'
,
to
=
'
program.Host
'
,
blank
=
True
)),
(
'
musicfocus
'
,
models
.
ManyToManyField
(
related_name
=
'
shows
'
,
verbose_name
=
'
Music focus
'
,
to
=
'
program.MusicFocus
'
,
blank
=
True
)),
(
'
musicfocus
'
,
models
.
ManyToManyField
(
related_name
=
'
shows
'
,
verbose_name
=
'
Music focus
'
,
to
=
'
program.MusicFocus
'
,
blank
=
True
)),
(
'
owners
'
,
models
.
ManyToManyField
(
related_name
=
'
shows
'
,
verbose_name
=
'
Owners
'
,
to
=
settings
.
AUTH_USER_MODEL
,
blank
=
True
)),
(
'
owners
'
,
models
.
ManyToManyField
(
related_name
=
'
shows
'
,
verbose_name
=
'
Owners
'
,
to
=
settings
.
AUTH_USER_MODEL
,
blank
=
True
)),
(
'
predecessor
'
,
models
.
ForeignKey
(
related_name
=
'
successors
'
,
verbose_name
=
'
Predecessor
'
,
blank
=
True
,
to
=
'
program.Show
'
,
null
=
True
)),
(
'
predecessor
'
,
models
.
ForeignKey
(
related_name
=
'
successors
'
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'
Predecessor
'
,
blank
=
True
,
to
=
'
program.Show
'
,
null
=
True
)),
],
],
options
=
{
options
=
{
'
ordering
'
:
(
'
slug
'
,),
'
ordering
'
:
(
'
slug
'
,),
...
@@ -182,8 +182,8 @@ class Migration(migrations.Migration):
...
@@ -182,8 +182,8 @@ class Migration(migrations.Migration):
(
'
id
'
,
models
.
AutoField
(
verbose_name
=
'
ID
'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'
id
'
,
models
.
AutoField
(
verbose_name
=
'
ID
'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'
start
'
,
models
.
DateTimeField
(
unique
=
True
,
verbose_name
=
'
Start time
'
)),
(
'
start
'
,
models
.
DateTimeField
(
unique
=
True
,
verbose_name
=
'
Start time
'
)),
(
'
end
'
,
models
.
DateTimeField
(
verbose_name
=
'
End time
'
)),
(
'
end
'
,
models
.
DateTimeField
(
verbose_name
=
'
End time
'
)),
(
'
programslot
'
,
models
.
ForeignKey
(
related_name
=
'
timeslots
'
,
verbose_name
=
'
Program slot
'
,
to
=
'
program.ProgramSlot
'
)),
(
'
programslot
'
,
models
.
ForeignKey
(
related_name
=
'
timeslots
'
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'
Program slot
'
,
to
=
'
program.ProgramSlot
'
)),
(
'
show
'
,
models
.
ForeignKey
(
related_name
=
'
timeslots
'
,
editable
=
False
,
to
=
'
program.Show
'
)),
(
'
show
'
,
models
.
ForeignKey
(
related_name
=
'
timeslots
'
,
on_delete
=
models
.
CASCADE
,
editable
=
False
,
to
=
'
program.Show
'
)),
],
],
options
=
{
options
=
{
'
ordering
'
:
(
'
start
'
,
'
end
'
),
'
ordering
'
:
(
'
start
'
,
'
end
'
),
...
@@ -204,22 +204,22 @@ class Migration(migrations.Migration):
...
@@ -204,22 +204,22 @@ class Migration(migrations.Migration):
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'
programslot
'
,
model_name
=
'
programslot
'
,
name
=
'
rrule
'
,
name
=
'
rrule
'
,
field
=
models
.
ForeignKey
(
related_name
=
'
programslots
'
,
verbose_name
=
'
Recurrence rule
'
,
to
=
'
program.RRule
'
),
field
=
models
.
ForeignKey
(
related_name
=
'
programslots
'
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'
Recurrence rule
'
,
to
=
'
program.RRule
'
),
),
),
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'
programslot
'
,
model_name
=
'
programslot
'
,
name
=
'
show
'
,
name
=
'
show
'
,
field
=
models
.
ForeignKey
(
related_name
=
'
programslots
'
,
verbose_name
=
'
Show
'
,
to
=
'
program.Show
'
),
field
=
models
.
ForeignKey
(
related_name
=
'
programslots
'
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'
Show
'
,
to
=
'
program.Show
'
),
),
),
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'
note
'
,
model_name
=
'
note
'
,
name
=
'
show
'
,
name
=
'
show
'
,
field
=
models
.
ForeignKey
(
related_name
=
'
notes
'
,
editable
=
False
,
to
=
'
program.Show
'
),
field
=
models
.
ForeignKey
(
related_name
=
'
notes
'
,
on_delete
=
models
.
CASCADE
,
editable
=
False
,
to
=
'
program.Show
'
),
),
),
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'
note
'
,
model_name
=
'
note
'
,
name
=
'
timeslot
'
,
name
=
'
timeslot
'
,
field
=
models
.
OneToOneField
(
verbose_name
=
'
Time slot
'
,
to
=
'
program.TimeSlot
'
),
field
=
models
.
OneToOneField
(
verbose_name
=
'
Time slot
'
,
on_delete
=
models
.
CASCADE
,
to
=
'
program.TimeSlot
'
),
),
),
migrations
.
AlterUniqueTogether
(
migrations
.
AlterUniqueTogether
(
name
=
'
programslot
'
,
name
=
'
programslot
'
,
...
...
This diff is collapsed.
Click to expand it.
program/models.py
+
58
−
83
View file @
d65f9b5e
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment