Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tools.ethertoff
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
27
Issues
27
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
osp
tools.ethertoff
Commits
cb8d42b5
Commit
cb8d42b5
authored
Apr 05, 2019
by
gijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finetuned on_delete settings
parent
34945270
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
contour/models.py
contour/models.py
+11
-11
No files found.
contour/models.py
View file @
cb8d42b5
...
@@ -41,7 +41,7 @@ class Venue(models.Model):
...
@@ -41,7 +41,7 @@ class Venue(models.Model):
class
Image
(
models
.
Model
):
class
Image
(
models
.
Model
):
published
=
models
.
BooleanField
(
default
=
False
)
published
=
models
.
BooleanField
(
default
=
False
)
oldImage
=
models
.
ImageField
(
upload_to
=
"images"
,
null
=
True
,
blank
=
True
)
oldImage
=
models
.
ImageField
(
upload_to
=
"images"
,
null
=
True
,
blank
=
True
)
image
=
FilerImageField
(
null
=
True
,
blank
=
True
,
on_delete
=
models
.
PROTECT
)
image
=
FilerImageField
(
null
=
True
,
blank
=
True
,
on_delete
=
models
.
CASCADE
)
title_nl
=
models
.
CharField
(
max_length
=
255
)
title_nl
=
models
.
CharField
(
max_length
=
255
)
tagline_nl
=
models
.
CharField
(
max_length
=
255
,
null
=
True
,
blank
=
True
)
tagline_nl
=
models
.
CharField
(
max_length
=
255
,
null
=
True
,
blank
=
True
)
title_en
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"Title (English)"
,
null
=
True
,
blank
=
True
)
title_en
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"Title (English)"
,
null
=
True
,
blank
=
True
)
...
@@ -153,8 +153,8 @@ class Event(models.Model):
...
@@ -153,8 +153,8 @@ class Event(models.Model):
published
=
models
.
BooleanField
(
default
=
True
)
published
=
models
.
BooleanField
(
default
=
True
)
continuous
=
models
.
BooleanField
(
default
=
False
)
continuous
=
models
.
BooleanField
(
default
=
False
)
project
=
models
.
ForeignKey
(
Project
,
on_delete
=
models
.
CASCADE
)
project
=
models
.
ForeignKey
(
Project
,
on_delete
=
models
.
CASCADE
)
event_type
=
models
.
ForeignKey
(
EventType
,
on_delete
=
models
.
PROTECT
)
event_type
=
models
.
ForeignKey
(
EventType
,
on_delete
=
models
.
SET_NULL
,
null
=
True
)
venue
=
models
.
ForeignKey
(
Venue
,
on_delete
=
models
.
PROTECT
)
venue
=
models
.
ForeignKey
(
Venue
,
on_delete
=
models
.
SET_NULL
,
null
=
True
)
notes_nl
=
models
.
TextField
(
null
=
True
,
blank
=
True
)
notes_nl
=
models
.
TextField
(
null
=
True
,
blank
=
True
)
notes_en
=
models
.
TextField
(
verbose_name
=
"Notes (English)"
,
null
=
True
,
blank
=
True
)
notes_en
=
models
.
TextField
(
verbose_name
=
"Notes (English)"
,
null
=
True
,
blank
=
True
)
start
=
models
.
DateTimeField
()
start
=
models
.
DateTimeField
()
...
@@ -216,8 +216,8 @@ class ProjectParticipant(models.Model):
...
@@ -216,8 +216,8 @@ class ProjectParticipant(models.Model):
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
participant
.
__str__
()
return
self
.
participant
.
__str__
()
participant
=
models
.
ForeignKey
(
Participant
,
on_delete
=
models
.
PROTECT
)
participant
=
models
.
ForeignKey
(
Participant
,
on_delete
=
models
.
CASCADE
)
project
=
SortableForeignKey
(
Project
,
on_delete
=
models
.
PROTECT
)
project
=
SortableForeignKey
(
Project
,
on_delete
=
models
.
CASCADE
)
role_nl
=
models
.
CharField
(
max_length
=
255
)
role_nl
=
models
.
CharField
(
max_length
=
255
)
role_en
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"Role (English)"
)
role_en
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"Role (English)"
)
position
=
models
.
PositiveIntegerField
(
default
=
0
,
editable
=
True
,
db_index
=
True
)
position
=
models
.
PositiveIntegerField
(
default
=
0
,
editable
=
True
,
db_index
=
True
)
...
@@ -243,8 +243,8 @@ class ProjectImage(models.Model):
...
@@ -243,8 +243,8 @@ class ProjectImage(models.Model):
class
Meta
:
class
Meta
:
ordering
=
(
'position'
,)
ordering
=
(
'position'
,)
project
=
SortableForeignKey
(
Project
,
on_delete
=
models
.
PROTECT
)
project
=
SortableForeignKey
(
Project
,
on_delete
=
models
.
CASCADE
)
image
=
models
.
ForeignKey
(
Image
,
on_delete
=
models
.
PROTECT
)
image
=
models
.
ForeignKey
(
Image
,
on_delete
=
models
.
CASCADE
)
position
=
models
.
PositiveIntegerField
(
default
=
0
,
editable
=
True
,
db_index
=
True
)
position
=
models
.
PositiveIntegerField
(
default
=
0
,
editable
=
True
,
db_index
=
True
)
cover_image
=
models
.
BooleanField
(
default
=
True
)
cover_image
=
models
.
BooleanField
(
default
=
True
)
...
@@ -253,8 +253,8 @@ class ProjectImage(models.Model):
...
@@ -253,8 +253,8 @@ class ProjectImage(models.Model):
class
ProjectPad
(
models
.
Model
):
class
ProjectPad
(
models
.
Model
):
project
=
models
.
ForeignKey
(
Project
,
on_delete
=
models
.
PROTECT
)
project
=
models
.
ForeignKey
(
Project
,
on_delete
=
models
.
CASCADE
)
pad
=
models
.
ForeignKey
(
Pad
,
on_delete
=
models
.
PROTECT
)
pad
=
models
.
ForeignKey
(
Pad
,
on_delete
=
models
.
CASCADE
)
position
=
models
.
PositiveIntegerField
(
default
=
0
,
editable
=
True
,
db_index
=
True
)
position
=
models
.
PositiveIntegerField
(
default
=
0
,
editable
=
True
,
db_index
=
True
)
def
__getattr__
(
self
,
attrname
):
def
__getattr__
(
self
,
attrname
):
...
@@ -281,7 +281,7 @@ class Page(models.Model):
...
@@ -281,7 +281,7 @@ class Page(models.Model):
title_en
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"Title (English)"
,
null
=
True
,
blank
=
True
)
title_en
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"Title (English)"
,
null
=
True
,
blank
=
True
)
summary_en
=
models
.
TextField
(
null
=
True
,
blank
=
True
,
verbose_name
=
"Summary (English) shown on parent page"
)
summary_en
=
models
.
TextField
(
null
=
True
,
blank
=
True
,
verbose_name
=
"Summary (English) shown on parent page"
)
content_en
=
models
.
TextField
(
verbose_name
=
"Content (English)"
,
null
=
True
,
blank
=
True
)
content_en
=
models
.
TextField
(
verbose_name
=
"Content (English)"
,
null
=
True
,
blank
=
True
)
parent
=
models
.
ForeignKey
(
'Page'
,
on_delete
=
models
.
CASCADE
,
related_name
=
'subpage'
,
null
=
True
,
blank
=
True
)
parent
=
models
.
ForeignKey
(
'Page'
,
on_delete
=
models
.
SET_NULL
,
related_name
=
'subpage'
,
null
=
True
,
blank
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
title
)
return
'{}'
.
format
(
self
.
title
)
...
@@ -318,7 +318,7 @@ class Loop(models.Model):
...
@@ -318,7 +318,7 @@ class Loop(models.Model):
published
=
models
.
BooleanField
(
default
=
False
)
published
=
models
.
BooleanField
(
default
=
False
)
description_nl
=
models
.
TextField
(
verbose_name
=
"Description (Dutch)"
,
null
=
True
,
blank
=
True
)
description_nl
=
models
.
TextField
(
verbose_name
=
"Description (Dutch)"
,
null
=
True
,
blank
=
True
)
description_en
=
models
.
TextField
(
verbose_name
=
"Description (English)"
,
null
=
True
,
blank
=
True
)
description_en
=
models
.
TextField
(
verbose_name
=
"Description (English)"
,
null
=
True
,
blank
=
True
)
page
=
models
.
ForeignKey
(
Page
,
on_delete
=
models
.
CASCADE
,
related_name
=
'loop'
,
null
=
True
,
blank
=
True
)
page
=
models
.
ForeignKey
(
Page
,
on_delete
=
models
.
SET_NULL
,
related_name
=
'loop'
,
null
=
True
,
blank
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
name
)
return
'{}'
.
format
(
self
.
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment